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 a
As 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 . rules
Is the idea to re-run rules on the first result in order to get the final action?
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:
As you can see, it itself must be able to use
fetch, so I need theRockconstraint.Is this something that you had to solve when writing
runTask? I seerulesused multiple times:Is the idea to re-run
ruleson the first result in order to get the final action?