Skip to content

Add a function to map the effect list #37

@sjoerdvisscher

Description

@sjoerdvisscher

After a bit of refactoring some freer-simple related code I ended up with this function:

mapEffs :: (Union effs ~> Union effs') -> Eff effs ~> Eff effs'
mapEffs f = loop where
    loop = \case
        Val a -> pure a
        E u q -> E (f u) (tsingleton $ qComp q loop)

It seems this might a useful thing to add to the library. Note that I have no idea if this implementation is a good one (or even if it makes sense really.)

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