Fork me on GitHub
#pathom
<
2020-11-05
>
markaddleman19:11:30

I'm reading through Pathom3 docs. First, congratulations on excellent tutorial and documentation! The built-in resolvers look very convenient. Have you considered a built-in Parameters resolver? I imagine it would be similar to the Environment resolver but examine [:ast :params]

wilkerlucio13:11:57

thanks 🙂 do you have a use case in mind for the params resolver generator?

markaddleman14:11:29

Bear in mind that I'm pretty new to Pathom2 and haven't explored Pathom3 beyond reading the docs. Here is what I was thinking: With parameter support, the smart map becomes an immutable, central computing object. I would assoc in parameters and ask for a result back - and it would do all of the hard work of figuring out how to string together functions (resolvers) to obtain the result. From a more mundane point of view, I have several resolvers that require parameters. It is inconvenient (and frankly a little weird) to inspect (-> env :ast :params) to obtain the information. Instead, it would be much more convenient to declare parameters as inputs to the resolver.

markaddleman14:11:31

Carrying this last example just a little further, I guess that most resolvers that require the env parameter only require it in order to access parameters. With a Parameter resolver, I imagine nearly all resolvers become a single arg function. I don't have a firm reason to think this is a good thing but it feels like a move in the right direction.

wilkerlucio14:11:58

at this moment I don't really see much usage on that sense, with any of the helpers you can already use params, maybe there is some misconception going on in our little chat here

wilkerlucio14:11:27

if you have a concrete use case, we can discuss around it