Skip to content

Inserting effects underneath others #30

@michaelpj

Description

@michaelpj

I find myself wanting to have values with a very specific list of effects, to constrain what my users can do, e.g. Eff '[E1, E2] a.

However, I then have issues interpreting those: if E1 can be interpreted in terms of E3, I need to get E3 under E1 (and perhaps E2) in the stack.

But this seems hard to do. I've managed to write:
raiseBehind :: forall effs a . Eff '[a] ~> Eff (a ': effs)
but I can't figure out how to write
raiseBehindMany :: forall effs effs' . Eff effs ~> Eff (effs :++: effs')
although it seems like it should be sensical.

For the time being, I'm working around this by using
data SomeEffs effs a = SomeEffs { runSomeEffs :: forall effs' . Members effs effs' => Eff effs' a }
but this isn't very nice.

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