lexi-lambda / freer-simple

A friendly effect system for Haskell
https://hackage.haskell.org/package/freer-simple
BSD 3-Clause "New" or "Revised" License
227 stars 19 forks source link

Lifting IO effect to ResourceT #25

Closed AlexeyRaga closed 5 years ago

AlexeyRaga commented 5 years ago

I have a bunch of interpreters which are described with Member IO r constraint.

I also have one effect whose interpreter needs to take care of resources so it wants Member (ResourceT IO) r. This comes from 3rd party libraries, in my case amazonka, so I can't really get rid of ResourceT here.

What would be the best way to compose these effects? Or is there a way to somehow "lift" existing IO effects into ResourceT IO when composing interpreters?

AlexeyRaga commented 5 years ago

Oh, thanks to Sandy I figured out that interpretM liftIO helps here :)