Skip to content
This repository has been archived by the owner on Jan 17, 2020. It is now read-only.

Commit

Permalink
Merge pull request #5 from TinkerTravel/master
Browse files Browse the repository at this point in the history
Update for PureScript 0.11
  • Loading branch information
jdegoes authored Apr 24, 2017
2 parents ca40f90 + 629f9b3 commit ea2e9c4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
20 changes: 10 additions & 10 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
"output"
],
"dependencies": {
"purescript-aff": "^2.0.3",
"purescript-control": "^2.0.0",
"purescript-eff": "^2.0.0",
"purescript-exceptions": "^2.0.0",
"purescript-monoid": "^2.2.0",
"purescript-newtype": "^1.3.0",
"purescript-prelude": "^2.5.0",
"purescript-tailrec": "^2.0.2",
"purescript-transformers": "^2.3.0"
"purescript-aff": "^3.0.0",
"purescript-control": "^3.0.0",
"purescript-eff": "^3.1.0",
"purescript-exceptions": "^3.0.0",
"purescript-monoid": "^3.0.0",
"purescript-newtype": "^2.0.0",
"purescript-prelude": "^3.0.0",
"purescript-tailrec": "^3.1.0",
"purescript-transformers": "^3.2.0"
},
"devDependencies": {
"purescript-psci-support": "^2.0.0"
"purescript-psci-support": "^3.0.0"
}
}
4 changes: 3 additions & 1 deletion src/Control/Monad/IO.purs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Control.Monad.Aff.Unsafe (unsafeCoerceAff)
import Control.Monad.Eff.Class (class MonadEff, liftEff)
import Control.Monad.Eff.Exception (Error)
import Control.Monad.Eff.Unsafe (unsafeCoerceEff)
import Control.Monad.Error.Class (class MonadError)
import Control.Monad.Error.Class (class MonadError, class MonadThrow)
import Control.Monad.IO.Effect (INFINITY)
import Control.Monad.IOSync (IOSync)
import Control.Monad.Rec.Class (class MonadRec)
Expand Down Expand Up @@ -55,6 +55,8 @@ instance monadAffIO :: MonadAff eff IO where
instance monadEffIO :: MonadEff eff IO where
liftEff = wrap <<< liftEff <<< unsafeCoerceEff

derive newtype instance monadThrowIO :: MonadThrow Error IO

derive newtype instance monadErrorIO :: MonadError Error IO

derive newtype instance altIO :: Alt IO
Expand Down
2 changes: 2 additions & 0 deletions src/Control/Monad/IO/Effect.purs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ module Control.Monad.IO.Effect
( INFINITY
) where

import Control.Monad.Eff (kind Effect)

foreign import data INFINITY :: Effect
4 changes: 3 additions & 1 deletion src/Control/Monad/IOSync.purs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Class (class MonadEff, liftEff)
import Control.Monad.Eff.Exception (Error, catchException, error, throwException)
import Control.Monad.Eff.Unsafe (unsafeCoerceEff)
import Control.Monad.Error.Class (class MonadError, catchError, throwError)
import Control.Monad.Error.Class (class MonadError, class MonadThrow, catchError, throwError)
import Control.Monad.IO.Effect (INFINITY)
import Control.Monad.Rec.Class (class MonadRec)
import Control.MonadZero (class MonadZero)
Expand Down Expand Up @@ -50,6 +50,8 @@ instance monadEffIOSync :: MonadEff eff IOSync where
instance monadErrorIOSync :: MonadError Error IOSync where
catchError a k = liftEff $
catchException (\e -> unwrap $ k e) (unsafeCoerceEff $ unwrap a)

instance monadThrowIOSync :: MonadThrow Error IOSync where
throwError = liftEff <<< throwException

instance altIOSync :: Alt IOSync where
Expand Down

0 comments on commit ea2e9c4

Please sign in to comment.