I have small concern if the whole typing of that has/or not a big sense
Well, you are just writing a bunch of functions returning Reader, whether or not you add an explicit type. The point is making the dependencies as implicit as possibile, the key is to put them as a last argument. Note that often people put the dependencies as a first argument
I am Software Developer, currently interested in static type languages (TypeScript, Elm, ReScript) mostly in the frontend land, but working actively in Python also. I am available for mentoring.
Well, you are just writing a bunch of functions returning
Reader
, whether or not you add an explicit type. The point is making the dependencies as implicit as possibile, the key is to put them as a last argument. Note that often people put the dependencies as a first argumentmaking composition more difficult.
all the following
g
s are equivalent (so feel free to choose the style you prefer)Yes the whole idea has a lot of sense, and I mean adding argument after not before. Thanks for clarifying!
I'm used to put deps as the first argument since this lets you partially apply f:
const f = (deps: Dependencies) => (b: boolean): string => (...)