Skip to content

Commit a61aa8f

Browse files
committed
Updates for 0.12
1 parent 1ee7089 commit a61aa8f

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

bower.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
"license": "MIT",
1313
"repository": {
1414
"type": "git",
15-
"url": "git://github.com/paf31/purescript-freet.git"
15+
"url": "git://github.com/purescript-contrib/purescript-freet.git"
1616
},
1717
"dependencies": {
18-
"purescript-control": "^3.0.0",
19-
"purescript-tailrec": "^3.0.0",
20-
"purescript-transformers": "^3.0.0",
21-
"purescript-exists": "^3.0.0",
22-
"purescript-eff": "^3.0.0"
18+
"purescript-control": "#compiler/0.12",
19+
"purescript-tailrec": "#compiler/0.12",
20+
"purescript-transformers": "#compiler/0.12",
21+
"purescript-exists": "#compiler/0.12",
22+
"purescript-effect": "#compiler/0.12"
2323
},
2424
"devDependencies": {
25-
"purescript-console": "^3.0.0"
25+
"purescript-console": "#compiler/0.12"
2626
}
2727
}

src/Control/Monad/Free/Trans.purs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ module Control.Monad.Free.Trans
1414
import Prelude
1515

1616
import Control.Apply (lift2)
17-
import Control.Monad.Eff.Class (class MonadEff, liftEff)
1817
import Control.Monad.Error.Class (class MonadThrow, throwError)
1918
import Control.Monad.Reader.Class (class MonadAsk, ask)
2019
import Control.Monad.Rec.Class (class MonadRec, Step(..), tailRecM)
@@ -25,6 +24,7 @@ import Data.Bifunctor (bimap)
2524
import Data.Either (Either(..))
2625
import Data.Exists (Exists, mkExists, runExists)
2726
import Data.Monoid (class Monoid, mempty)
27+
import Effect.Class (class MonadEffect, liftEffect)
2828

2929
-- | Instead of implementing `bind` directly, we capture the bind using this data structure, to
3030
-- | evaluate later.
@@ -88,8 +88,8 @@ instance semigroupFreeT :: (Functor f, Monad m, Semigroup w) => Semigroup (FreeT
8888
instance monoidFreeT :: (Functor f, Monad m, Monoid w) => Monoid (FreeT f m w) where
8989
mempty = pure mempty
9090

91-
instance monadEffFreeT :: (Functor f, MonadEff eff m) => MonadEff eff (FreeT f m) where
92-
liftEff = lift <<< liftEff
91+
instance monadEffectFreeT :: (Functor f, MonadEffect m) => MonadEffect (FreeT f m) where
92+
liftEffect = lift <<< liftEffect
9393

9494
instance monadAskFreeT :: (Functor f, MonadAsk r m) => MonadAsk r (FreeT f m) where
9595
ask = lift ask
@@ -109,11 +109,11 @@ liftFreeT fa = FreeT \_ -> pure (Right (map pure fa))
109109

110110
-- | Change the underlying `Monad` for a `FreeT` action.
111111
hoistFreeT :: forall f m n a. Functor f => Functor n => (m ~> n) -> FreeT f m a -> FreeT f n a
112-
hoistFreeT = bimapFreeT id
112+
hoistFreeT = bimapFreeT identity
113113

114114
-- | Change the base functor `f` for a `FreeT` action.
115115
interpret :: forall f g m a. Functor f => Functor m => (f ~> g) -> FreeT f m a -> FreeT g m a
116-
interpret nf = bimapFreeT nf id
116+
interpret nf = bimapFreeT nf identity
117117

118118
-- | Change the base functor `f` and the underlying `Monad` for a `FreeT` action.
119119
bimapFreeT :: forall f g m n a. Functor f => Functor n => (f ~> g) -> (m ~> n) -> FreeT f m a -> FreeT g n a

test/Main.purs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ module Test.Main where
22

33
import Prelude
44

5-
import Control.Monad.Eff (Eff)
6-
import Control.Monad.Eff.Class (liftEff)
7-
import Control.Monad.Eff.Console (CONSOLE, log)
5+
import Effect (Effect)
6+
import Effect.Class (liftEffect)
7+
import Effect.Console (log)
88
import Control.Monad.Free.Trans (FreeT, runFreeT, liftFreeT)
99
import Control.Monad.Rec.Class (forever)
1010
import Control.Monad.Trans.Class (lift)
@@ -23,18 +23,18 @@ writeLine :: forall m. Monad m => String -> FreeT TeletypeF m Unit
2323
writeLine s = liftFreeT (WriteLine s unit)
2424

2525
readLine :: forall m. Monad m => FreeT TeletypeF m String
26-
readLine = liftFreeT (ReadLine id)
26+
readLine = liftFreeT (ReadLine identity)
2727

28-
mockTeletype :: forall a eff. Teletype (Eff (console :: CONSOLE | eff)) a -> Eff (console :: CONSOLE | eff) a
28+
mockTeletype :: forall a. Teletype Effect a -> Effect a
2929
mockTeletype = runFreeT interp
3030
where
3131
interp (WriteLine s next) = do
32-
liftEff (log s)
32+
liftEffect (log s)
3333
pure next
3434
interp (ReadLine k) = do
3535
pure (k "Fake input")
3636

37-
main :: forall eff. Eff (console :: CONSOLE | eff) Unit
37+
main :: Effect Unit
3838
main = mockTeletype $ forever do
3939
lift $ log "Enter some input:"
4040
s <- readLine

0 commit comments

Comments
 (0)