Skip to content

Add instance for MonadAff #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"purescript-exists": "^4.0.0",
"purescript-prelude": "^4.0.0",
"purescript-tailrec": "^4.0.0",
"purescript-transformers": "^4.0.0"
"purescript-transformers": "^4.0.0",
"purescript-aff": "^5.1.1"
},
"devDependencies": {
"purescript-console": "^4.0.0"
Expand Down
4 changes: 4 additions & 0 deletions src/Control/Monad/Free/Trans.purs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import Control.Monad.Writer.Class (class MonadTell, tell)
import Data.Bifunctor (bimap)
import Data.Either (Either(..))
import Data.Exists (Exists, mkExists, runExists)
import Effect.Aff.Class (class MonadAff, liftAff)
import Effect.Class (class MonadEffect, liftEffect)

-- | Instead of implementing `bind` directly, we capture the bind using this data structure, to
Expand Down Expand Up @@ -91,6 +92,9 @@ instance monoidFreeT :: (Functor f, Monad m, Monoid w) => Monoid (FreeT f m w) w
instance monadEffectFreeT :: (Functor f, MonadEffect m) => MonadEffect (FreeT f m) where
liftEffect = lift <<< liftEffect

instance monadAffFreeT :: (Functor f, MonadAff m) => MonadAff (FreeT f m) where
liftAff = lift <<< liftAff

instance monadAskFreeT :: (Functor f, MonadAsk r m) => MonadAsk r (FreeT f m) where
ask = lift ask

Expand Down