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.)
After a bit of refactoring some
freer-simple
related code I ended up with this function: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.)