Closed BebeSparkelSparkel closed 1 year ago
That's a good point. Not going to do it tonight, because I'm about to go to the grocery store, but I do have time to give a vague idea: there are many times we want to run in a monad stack which is not IO, and we have some context that we can supply to map our ProgramT
to IO
from a richer monad in which its more pleasant to write our CLI app in. In particular, it might be a reader of some dynamic context or settings, for instance database connection pool and configuration.
An example is that we might have ReaderT (Pool Connection) IO
as the monad we'd like to use, and with a Pool Connection
called p
, we can create a function to pass to hoist with flip runReaderT p
.
I see. Reader could be very useful here. Looking forward to seeing what you come up with.
I do not see any usage of
hoist
. It would be nice to have some documentation of its usage in the README.