Skip to content

Commit

Permalink
Merge pull request #8 from xgrommx/master
Browse files Browse the repository at this point in the history
Migrate to 0.12
  • Loading branch information
cryogenian authored Jun 28, 2018
2 parents 80ee558 + dc08a42 commit caaca2d
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 28 deletions.
11 changes: 6 additions & 5 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
"package.json"
],
"dependencies": {
"purescript-fixed-points": "^4.0.0",
"purescript-free": "^4.0.0",
"purescript-transformers": "^3.0.0",
"purescript-profunctor": "^3.0.0"
"purescript-prelude": "^4.0.0",
"purescript-fixed-points": "^5.0.0",
"purescript-free": "^5.0.0",
"purescript-transformers": "^4.1.0",
"purescript-profunctor": "^4.0.0"
},
"devDependencies": {
"purescript-console": "^3.0.0"
"purescript-console": "^4.1.0"
}
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"test": "pulp test -- --censor-lib --strict"
},
"devDependencies": {
"pulp": "^11.0.0",
"purescript": "^0.11.3",
"purescript-psa": "^0.5.0",
"rimraf": "^2.5.4"
"pulp": "^12.2.0",
"purescript": "0.12",
"purescript-psa": "^0.6.0",
"rimraf": "^2.6.2"
}
}
4 changes: 2 additions & 2 deletions src/Matryoshka/DistributiveLaw.purs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ distZygoT g k fe =
EnvT $ Tuple (g (fst <<< runEnvT <$> fe)) (k (lower <$> fe))

distHisto f. Functor f DistributiveLaw f (Cofree f)
distHisto = distGHisto id
distHisto = distGHisto identity

distGHisto
f h
Expand Down Expand Up @@ -102,7 +102,7 @@ distGApoT
distGApoT g k = map ExceptT <<< k <<< map (distGApo g) <<< runExceptT

distFutu f. Functor f DistributiveLaw (Free f) f
distFutu = distGFutu id
distFutu = distGFutu identity

distGFutu
f h
Expand Down
2 changes: 1 addition & 1 deletion src/Matryoshka/Fold.purs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ transPara
u
transPara f = go
where
go t = mapR (f <<< map (id &&& go)) t
go t = mapR (f <<< map (identity &&& go)) t

transParaT
t f
Expand Down
6 changes: 3 additions & 3 deletions src/Matryoshka/Refold.purs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import Control.Monad.Free (Free)

import Data.Identity (Identity(..))
import Data.Newtype (unwrap)
import Data.Profunctor (lmap)
import Data.Profunctor (lcmap)
import Data.Traversable (class Traversable, traverse)

import Matryoshka.Algebra (Algebra, AlgebraM, GAlgebra, GAlgebraM)
Expand Down Expand Up @@ -121,7 +121,7 @@ codyna
GCoalgebra (Free f) f a
a
b
codyna f = ghylo distCata distFutu (lmap (map unwrap) f)
codyna f = ghylo distCata distFutu (lcmap (map unwrap) f)

codynaM
f m a b
Expand All @@ -131,7 +131,7 @@ codynaM
GCoalgebraM (Free f) m f a
a
m b
codynaM f = ghyloM distCata distFutu (lmap (map unwrap) f)
codynaM f = ghyloM distCata distFutu (lcmap (map unwrap) f)

chrono
f a b
Expand Down
8 changes: 4 additions & 4 deletions src/Matryoshka/Unfold.purs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ transPostpro f g = go
apo t f a. Corecursive t f GCoalgebra (Either t) f a a t
apo f = go
where
go a = embed $ either id go <$> f a
go a = embed $ either identity go <$> f a

gapo
t f a b
Expand Down Expand Up @@ -198,7 +198,7 @@ apoM f = go
elgotApo t f a. Corecursive t f ElgotCoalgebra (Either t) f a a t
elgotApo f = go
where
go a = either id (embed <<< map go) $ f a
go a = either identity (embed <<< map go) $ f a

transApo
t f u g
Expand All @@ -209,7 +209,7 @@ transApo
u
transApo f = go
where
go t = mapR (map (either id go) <<< f) t
go t = mapR (map (either identity go) <<< f) t

transApoT
t f
Expand All @@ -220,7 +220,7 @@ transApoT
t
transApoT f = go
where
go t = either id (mapR (map go)) $ f t
go t = either identity (mapR (map go)) $ f t

futu t f a. Corecursive t f GCoalgebra (Free f) f a a t
futu = gana distFutu
Expand Down
6 changes: 3 additions & 3 deletions test/Test/Example/Expr.purs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Test.Example.Expr where

import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log, logShow)
import Effect (Effect)
import Effect.Console (log, logShow)
import Data.Functor.Mu (Mu)
import Matryoshka (class Corecursive, class Recursive, Algebra, cata, embed)
import Prelude hiding (mul)
Expand All @@ -28,7 +28,7 @@ someExpr = mul (num 2) (mul (num 3) (num 4))

type Expr = Mu ExprF

exprExample :: forall t. Eff (console :: CONSOLE | t) Unit
exprExample :: Effect Unit
exprExample = do
log "expr example"
logShow $ evalExpr (someExpr :: Expr)
6 changes: 3 additions & 3 deletions test/Test/Example/List.purs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module Test.Example.List where

import Prelude

import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log, logShow)
import Effect (Effect)
import Effect.Console (log, logShow)

import Data.Functor.Mu (Mu)
import Data.TacitString (TacitString)
Expand Down Expand Up @@ -36,7 +36,7 @@ fac = hylo prod count

type List a = Mu (ListF a)

listExample :: forall t. Eff (console :: CONSOLE | t) Unit
listExample :: Effect Unit
listExample = do
log "list example"
let someList = cons 1 (cons 2 (cons 3 (cons 4 nil)))
Expand Down
5 changes: 2 additions & 3 deletions test/Test/Main.purs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
module Test.Main where

import Prelude
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE)
import Effect (Effect)
import Test.Example.Expr (exprExample)
import Test.Example.List (listExample)

main :: forall t. Eff ( console :: CONSOLE | t) Unit
main :: Effect Unit
main = do
exprExample
listExample

0 comments on commit caaca2d

Please sign in to comment.