Skip to content

Commit 8b9cee0

Browse files
authored
Merge pull request #15 from purescript-contrib/compiler/0.12
Compiler/0.12
2 parents 1ee7089 + 43daf97 commit 8b9cee0

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

bower.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@
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-bifunctors": "^4.0.0",
19+
"purescript-effect": "^2.0.0",
20+
"purescript-either": "^4.0.0",
21+
"purescript-exists": "^4.0.0",
22+
"purescript-prelude": "^4.0.0",
23+
"purescript-tailrec": "^4.0.0",
24+
"purescript-transformers": "^4.0.0"
2325
},
2426
"devDependencies": {
25-
"purescript-console": "^3.0.0"
27+
"purescript-console": "^4.0.0"
2628
}
2729
}

src/Control/Monad/Free/Trans.purs

Lines changed: 5 additions & 6 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)
@@ -24,7 +23,7 @@ import Control.Monad.Writer.Class (class MonadTell, tell)
2423
import Data.Bifunctor (bimap)
2524
import Data.Either (Either(..))
2625
import Data.Exists (Exists, mkExists, runExists)
27-
import Data.Monoid (class Monoid, mempty)
26+
import Effect.Class (class MonadEffect, liftEffect)
2827

2928
-- | Instead of implementing `bind` directly, we capture the bind using this data structure, to
3029
-- | evaluate later.
@@ -88,8 +87,8 @@ instance semigroupFreeT :: (Functor f, Monad m, Semigroup w) => Semigroup (FreeT
8887
instance monoidFreeT :: (Functor f, Monad m, Monoid w) => Monoid (FreeT f m w) where
8988
mempty = pure mempty
9089

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

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

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

114113
-- | Change the base functor `f` for a `FreeT` action.
115114
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
115+
interpret nf = bimapFreeT nf identity
117116

118117
-- | Change the base functor `f` and the underlying `Monad` for a `FreeT` action.
119118
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)