-
Notifications
You must be signed in to change notification settings - Fork 11
Using a custom monad stack and effects #12
Copy link
Copy link
Open
Description
In my adventures with Rock I find myself getting some conflicts while using Effectful. It would appear that everything must run in a Task, but it's not clear to me how make use of the polymorphism granted by MonadFetch (which seems to be an MTL-style typeclass).
For reference, I'd like my ideal query interpreter to have this shape:
rules
:: (Rock :> es, IOE :> es, FileSystem :> es)
=> Query a
-> Eff es aAs you can see, it itself must be able to use fetch, so I need the Rock constraint.
Is this something that you had to solve when writing runTask? I see rules used multiple times:
runTask :: Rules f -> Task f a -> IO a
runTask rules (Task task) =
runReaderT task $ Fetch $ runTask rules . rulesIs the idea to re-run rules on the first result in order to get the final action?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels