Skip to content

Commit f7f76c9

Browse files
authored
Compiler/0.12 (#17)
Updates for 0.12 (#15) and (#16)
1 parent 9025683 commit f7f76c9

File tree

6 files changed

+22
-24
lines changed

6 files changed

+22
-24
lines changed

bower.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@
1010
"url": "git://github.com/ethul/purescript-freeap.git"
1111
},
1212
"dependencies": {
13-
"purescript-exists": "^3.0.0",
14-
"purescript-const": "^3.0.0"
13+
"purescript-exists": "^4.0.0",
14+
"purescript-const": "^4.0.0"
1515
},
1616
"devDependencies": {
17-
"purescript-either": "^3.0.0",
18-
"purescript-integers": "^3.0.0",
19-
"purescript-generics": "^4.0.0",
20-
"purescript-console": "^3.0.0",
21-
"purescript-exceptions": "^3.0.0",
22-
"purescript-quickcheck-laws": "^3.0.1"
17+
"purescript-either": "^4.0.0",
18+
"purescript-integers": "^4.0.0",
19+
"purescript-console": "^4.1.0",
20+
"purescript-exceptions": "^4.0.0",
21+
"purescript-quickcheck-laws": "paulyoung/purescript-quickcheck-laws#compiler/0.12"
2322
}
2423
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"build": "pulp build -- --censor-lib --strict"
77
},
88
"devDependencies": {
9-
"pulp": "^11.0.0",
10-
"purescript-psa": "^0.5.1",
11-
"rimraf": "^2.6.1"
9+
"pulp": "^12.2.0",
10+
"purescript-psa": "^0.6.0",
11+
"rimraf": "^2.6.2"
1212
}
1313
}

src/Control/Applicative/Free.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ module Control.Applicative.Free
88
) where
99

1010
import Prelude
11+
1112
import Data.Const (Const(..))
1213
import Data.Either (Either(..))
1314
import Data.List (List(..))
1415
import Data.List.NonEmpty as NEL
15-
import Data.Monoid (class Monoid)
1616
import Data.Newtype (unwrap)
1717
import Data.NonEmpty ((:|))
1818
import Data.Tuple (Tuple(..))
@@ -110,7 +110,7 @@ goLeft fStack valStack nat func count = case func of
110110
-- | Run a free applicative functor using the applicative instance for
111111
-- | the type constructor `f`.
112112
retractFreeAp :: forall f a. Applicative f => FreeAp f a -> f a
113-
retractFreeAp = foldFreeAp id
113+
retractFreeAp = foldFreeAp identity
114114

115115
-- | Natural transformation from `FreeAp f a` to `FreeAp g a` given a
116116
-- | natural transformation from `f` to `g`.

test/Test/Control/Applicative/Free.purs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ import Control.Applicative.Free (FreeAp, liftFreeAp, analyzeFreeAp, retractFreeA
1010
import Control.Applicative.Free.Gen as GenF
1111
import Data.Either (Either(..))
1212
import Data.Tuple (Tuple)
13+
import Effect (Effect)
1314
import Test.QuickCheck (class Arbitrary, class Coarbitrary, arbitrary)
1415
import Test.QuickCheck.Gen (Gen)
15-
import Test.QuickCheck.Laws (QC, A, checkLaws)
16+
import Test.QuickCheck.Laws (A, checkLaws)
1617
import Test.QuickCheck.Laws.Control as Control
1718
import Test.QuickCheck.Laws.Data as Data
1819
import Type.Proxy (Proxy(..), Proxy2(..))
@@ -42,7 +43,7 @@ buildExpected 0 _ acc = acc
4243
buildExpected n x acc = buildExpected (n - 1) x (acc <> x)
4344

4445
checkAnalyze :: Either String String
45-
checkAnalyze =
46+
checkAnalyze =
4647
if result == expected
4748
then Right result
4849
else Left (result <> " is not " <> expected)
@@ -55,7 +56,7 @@ checkAnalyze =
5556

5657

5758
checkStack :: Either String String
58-
checkStack =
59+
checkStack =
5960
if result == expected
6061
then Right "safe for 100000 node"
6162
else Left (result <> " is not " <> expected)
@@ -70,7 +71,7 @@ checkStack =
7071
newtype ArbFreeAp a = ArbFreeAp (FreeAp (Tuple (Array String)) a)
7172

7273
instance arbitraryArbFreeAp :: (Coarbitrary a, Arbitrary a) => Arbitrary (ArbFreeAp a) where
73-
arbitrary = ArbFreeAp <$>
74+
arbitrary = ArbFreeAp <$>
7475
GenF.genFree
7576
arbitrary
7677
(arbitrary :: Gen a)
@@ -83,7 +84,7 @@ derive newtype instance functorArbFreeAp :: Functor ArbFreeAp
8384
derive newtype instance applyArbFreeAp :: Apply ArbFreeAp
8485
derive newtype instance applicativeArbFreeAp :: Applicative ArbFreeAp
8586

86-
check eff. QC eff Unit
87+
check Effect Unit
8788
check = checkLaws "FreeAp" do
8889
Data.checkEq prxFree
8990
Data.checkFunctor prx2Free

test/Test/Control/Applicative/Free/Validation.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module Test.Control.Applicative.Free.Validation
66
import Prelude (class Show, show, (<<<), (==), (<$>), (<*>), (<>))
77

88
import Control.Applicative.Free (FreeAp, foldFreeAp, liftFreeAp)
9-
import Control.Monad.Eff.Exception.Unsafe (unsafeThrow)
9+
import Effect.Exception.Unsafe (unsafeThrow)
1010

1111
import Data.Either (Either(..))
1212
import Data.Int (fromString)

test/Test/Main.purs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
module Test.Main where
22

33
import Prelude
4-
import Control.Monad.Eff (Eff)
5-
import Control.Monad.Eff.Console (CONSOLE, log, logShow)
6-
import Control.Monad.Eff.Exception (EXCEPTION)
7-
import Control.Monad.Eff.Random (RANDOM)
4+
import Effect (Effect)
5+
import Effect.Console (log, logShow)
86
import Test.Control.Applicative.Free as FreeTest
97
import Test.Control.Applicative.Free.Validation as Validation
108

11-
main :: Eff (console CONSOLE , random RANDOM , exception EXCEPTION) Unit
9+
main :: Effect Unit
1210
main = do
1311
log "\nvalid case:"
1412
logShow (Validation.runForm "Joe" "Smith" "28")

0 commit comments

Comments
 (0)