Skip to content

Using a custom monad stack and effects #12

@Kleidukos

Description

@Kleidukos

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions