git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #1137 from purescript/no-implicit-prelude
6a21e12Gary Burgess
examples/failing/365.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3class C a where
5class C a where
4 f :: a -> a
6 f :: a -> a
5 g :: a -> a
7 g :: a -> a
examples/failing/438.purs+4−2
@@ -1,9 +1,11 @@
1module Main where
1module Main where
2−
2+
3+import Prelude
4+
3data Fix f = In (f (Fix f))
5data Fix f = In (f (Fix f))
4
6
5instance eqFix :: (Eq (f (Fix f))) => Eq (Fix f) where
7instance eqFix :: (Eq (f (Fix f))) => Eq (Fix f) where
6 (==) (In f) (In g) = f == g
8 (==) (In f) (In g) = f == g
7 (/=) a b = not (a == b)
9 (/=) a b = not (a == b)
8−
10+
9example = In [] == In []
11example = In [] == In []
examples/failing/ArrayType.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Debug.Trace
4import Debug.Trace
4
5
5bar :: Number -> Number -> Number
6bar :: Number -> Number -> Number
examples/failing/Arrays.purs+2−2
@@ -1,5 +1,5 @@
1module Main where
1module Main where
2
2
3− import Prelude
3+import Prelude
4
4
5− test = \arr -> arr !! (0 !! 0)
5+test = \arr -> arr !! (0 !! 0)
examples/failing/Do.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3test1 = do let x = 1
5test1 = do let x = 1
4
6
5test2 y = do x <- y
7test2 y = do x <- y
examples/failing/DuplicateDeclarationsInLet.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3foo = a
5foo = a
4 where
6 where
5 a :: Number
7 a :: Number
examples/failing/DuplicateProperties1.purs+2
@@ -1,5 +1,7 @@
1module DuplicateProperties where
1module DuplicateProperties where
2
2
3+import Prelude
4+
3foreign import data Test :: # * -> *
5foreign import data Test :: # * -> *
4
6
5foreign import subtractX :: forall r. Test (x :: Unit | r) -> Test r
7foreign import subtractX :: forall r. Test (x :: Unit | r) -> Test r
examples/failing/DuplicateProperties2.purs+2
@@ -1,5 +1,7 @@
1module DuplicateProperties where
1module DuplicateProperties where
2
2
3+import Prelude
4+
3foreign import data Test :: # * -> *
5foreign import data Test :: # * -> *
4
6
5foreign import subtractX :: forall r. Test (x :: Unit | r) -> Test r
7foreign import subtractX :: forall r. Test (x :: Unit | r) -> Test r
examples/failing/DuplicateTypeVars.purs+2
@@ -1,3 +1,5 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3type Foo a a = a
5type Foo a a = a
examples/failing/Foldable.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3class Foldable f where
5class Foldable f where
4 fold :: forall a b. (a -> b -> b) -> b -> f a -> b
6 fold :: forall a b. (a -> b -> b) -> b -> f a -> b
5 size :: forall a. f a -> Number
7 size :: forall a. f a -> Number
examples/failing/InstanceExport.purs+2
@@ -1,5 +1,7 @@
1module InstanceExport (S(..), f) where
1module InstanceExport (S(..), f) where
2
2
3+import Prelude
4+
3newtype S = S String
5newtype S = S String
4
6
5class F a where
7class F a where
examples/failing/KindError.purs+3−1
@@ -1,3 +1,5 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3− data KindError f a = One f | Two (f a)
5+data KindError f a = One f | Two (f a)
examples/failing/LeadingZeros1.purs+3−1
@@ -1,3 +1,5 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3−x = 01
5+x = 01
examples/failing/LeadingZeros2.purs+3−1
@@ -1,3 +1,5 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3−x = 00.1
5+x = 00.1
examples/failing/Let.purs+2
@@ -1,3 +1,5 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3test = let x = x in x
5test = let x = x in x
examples/failing/MPTCs.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3class Foo a where
5class Foo a where
4 f :: a -> a
6 f :: a -> a
5
7
examples/failing/MissingClassExport.purs+4−2
@@ -1,4 +1,6 @@
1module Test (bar) where
1module Test (bar) where
2
2
3+import Prelude
4+
3− class Foo a where
5+class Foo a where
4− bar :: a -> a
6+ bar :: a -> a
examples/failing/MissingClassMemberExport.purs+4−2
@@ -1,4 +1,6 @@
1module Test (Foo) where
1module Test (Foo) where
2
2
3+import Prelude
4+
3− class Foo a where
5+class Foo a where
4− bar :: a -> a
6+ bar :: a -> a
examples/failing/MultipleErrors.purs+2
@@ -1,5 +1,7 @@
1module MultipleErrors where
1module MultipleErrors where
2
2
3+import Prelude
4+
3foo :: Number -> Number
5foo :: Number -> Number
4foo 0 = "Test"
6foo 0 = "Test"
5foo n = bar (n - 1)
7foo n = bar (n - 1)
examples/failing/MultipleErrors2.purs+2
@@ -1,5 +1,7 @@
1module MultipleErrors2 where
1module MultipleErrors2 where
2
2
3+import Prelude
4+
3foo = itDoesntExist
5foo = itDoesntExist
4
6
5bar = neitherDoesThis
7bar = neitherDoesThis
examples/failing/MutRec.purs+2
@@ -1,5 +1,7 @@
1module MutRec where
1module MutRec where
2
2
3+import Prelude
4+
3x = y
5x = y
4
6
5y = x
7y = x
examples/failing/MutRec2.purs+2
@@ -1,3 +1,5 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3x = x
5x = x
examples/failing/NewtypeMultiArgs.purs+2
@@ -1,3 +1,5 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3newtype Thing = Thing String Boolean
5newtype Thing = Thing String Boolean
examples/failing/NewtypeMultiCtor.purs+2
@@ -1,3 +1,5 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3newtype Thing = Thing String | Other
5newtype Thing = Thing String | Other
examples/failing/NoOverlap.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3data Foo = Foo
5data Foo = Foo
4
6
5instance showFoo1 :: Show Foo where
7instance showFoo1 :: Show Foo where
examples/failing/NullaryAbs.purs+3−1
@@ -1,3 +1,5 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3− func = \ -> "no"
5+func = \ -> "no"
examples/failing/Object.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3test o = o.foo
5test o = o.foo
4
6
5test1 = test {}
7test1 = test {}
examples/failing/OverlappingArguments.purs+2
@@ -1,3 +1,5 @@
1module OverlappingArguments where
1module OverlappingArguments where
2
2
3+import Prelude
4+
3f x x = x
5f x x = x
examples/failing/OverlappingBinders.purs+2
@@ -1,5 +1,7 @@
1module OverlappingBinders where
1module OverlappingBinders where
2
2
3+import Prelude
4+
3data S a = S a (S a)
5data S a = S a (S a)
4
6
5f x = case x of
7f x = case x of
examples/failing/OverlappingInstances.purs+2
@@ -1,5 +1,7 @@
1module OverlappingInstances where
1module OverlappingInstances where
2
2
3+import Prelude
4+
3data A = A
5data A = A
4
6
5instance showA1 :: Show A where
7instance showA1 :: Show A where
examples/failing/OverlappingInstances2.purs+2
@@ -1,5 +1,7 @@
1module OverlappingInstances where
1module OverlappingInstances where
2
2
3+import Prelude
4+
3data A = A | B
5data A = A | B
4
6
5instance eqA1 :: Eq A where
7instance eqA1 :: Eq A where
examples/failing/OverlappingVars.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3class OverlappingVars a where
5class OverlappingVars a where
4 f :: a -> a
6 f :: a -> a
5
7
examples/failing/Rank2Types.purs+3−3
@@ -1,7 +1,7 @@
1module Main where
1module Main where
2
2
3− import Prelude
3+import Prelude
4
4
5− foreign import test :: (forall a. a -> a) -> Number
5+foreign import test :: (forall a. a -> a) -> Number
6
6
7− test1 = test (\n -> n + 1)
7+test1 = test (\n -> n + 1)
examples/failing/Reserved.purs+2
@@ -1,4 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3(<) :: Number -> Number -> Number
5(<) :: Number -> Number -> Number
4(<) a b = !(a >= b)
6(<) a b = !(a >= b)
examples/failing/RowConstructors1.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3data Foo = Bar
5data Foo = Bar
4type Baz = { | Foo }
6type Baz = { | Foo }
5
7
examples/failing/RowConstructors2.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3type Foo r = (x :: Number | r)
5type Foo r = (x :: Number | r)
4type Bar = { | Foo }
6type Bar = { | Foo }
5
7
examples/failing/RowConstructors3.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3type Foo = { x :: Number }
5type Foo = { x :: Number }
4type Bar = { | Foo }
6type Bar = { | Foo }
5
7
examples/failing/SkolemEscape.purs+4−2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3− foreign import foo :: (forall a. a -> a) -> Number
3+import Prelude
4
4
5+foreign import foo :: (forall a. a -> a) -> Number
6+
5− test = \x -> foo x
7+test = \x -> foo x
examples/failing/Superclasses1.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3class Su a where
5class Su a where
4 su :: a -> a
6 su :: a -> a
5
7
examples/failing/Superclasses2.purs+2
@@ -1,5 +1,7 @@
1module CycleInSuperclasses where
1module CycleInSuperclasses where
2
2
3+import Prelude
4+
3class (Foo a) <= Bar a
5class (Foo a) <= Bar a
4
6
5class (Bar a) <= Foo a
7class (Bar a) <= Foo a
examples/failing/Superclasses3.purs+2
@@ -1,5 +1,7 @@
1module UnknownSuperclassTypeVar where
1module UnknownSuperclassTypeVar where
2
2
3+import Prelude
4+
3class Foo a
5class Foo a
4
6
5class (Foo b) <= Bar a
7class (Foo b) <= Bar a
examples/failing/Superclasses4.purs+2
@@ -1,5 +1,7 @@
1module OverlappingInstances where
1module OverlappingInstances where
2
2
3+import Prelude
4+
3class Foo a
5class Foo a
4
6
5instance foo1 :: Foo Number
7instance foo1 :: Foo Number
examples/failing/TopLevelCaseNoArgs.purs+6−3
@@ -1,4 +1,7 @@
1module Main where
1module Main where
2+
3+import Prelude
4+
2− foo :: Number
5+foo :: Number
3− foo = 1
6+foo = 1
4− foo = 2
7+foo = 2
examples/failing/TypeClassInstances.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3class A a where
5class A a where
4 a :: a -> String
6 a :: a -> String
5 b :: a -> Number
7 b :: a -> Number
examples/failing/TypeError.purs+2−2
@@ -1,5 +1,5 @@
1module Main where
1module Main where
2
2
3− import Prelude
3+import Prelude
4
4
5− test = 1 ++ "A"
5+test = 1 ++ "A"
examples/failing/TypeSynonyms.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3type T1 = Array T2
5type T1 = Array T2
4
6
5type T2 = T1
7type T2 = T1
examples/failing/TypeSynonyms2.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3class Foo a where
5class Foo a where
4 foo :: a -> String
6 foo :: a -> String
5
7
examples/failing/TypeSynonyms3.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3class Foo a where
5class Foo a where
4 foo :: a -> String
6 foo :: a -> String
5
7
examples/failing/TypeSynonyms4.purs+2
@@ -1,5 +1,7 @@
1module TypeSynonyms4 where
1module TypeSynonyms4 where
2
2
3+import Prelude
4+
3type F x y = x -> y
5type F x y = x -> y
4
6
5type G x = F x
7type G x = F x
examples/failing/TypeSynonyms5.purs+2
@@ -1,3 +1,5 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3type T = T
5type T = T
examples/failing/TypeWildcards1.purs+2
@@ -1,4 +1,6 @@
1module TypeWildcards where
1module TypeWildcards where
2
2
3+import Prelude
4+
3type Test = _
5type Test = _
4
6
examples/failing/TypeWildcards2.purs+2
@@ -1,4 +1,6 @@
1module TypeWildcards where
1module TypeWildcards where
2
2
3+import Prelude
4+
3data Test = Test _
5data Test = Test _
4
6
examples/failing/TypeWildcards3.purs+2
@@ -1,5 +1,7 @@
1module TypeWildcards where
1module TypeWildcards where
2
2
3+import Prelude
4+
3data Foo a = Foo
5data Foo a = Foo
4
6
5instance showFoo :: Show (Foo _) where
7instance showFoo :: Show (Foo _) where
examples/failing/UnderscoreModuleName.purs+2
@@ -1,3 +1,5 @@
1module Bad_Module where
1module Bad_Module where
2
2
3+import Prelude
4+
3main = Debug.Trace.trace "Done"
5main = Debug.Trace.trace "Done"
examples/failing/UnifyInTypeInstanceLookup.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3data Z = Z
5data Z = Z
4data S n = S n
6data S n = S n
5
7
examples/failing/UnknownType.purs+2
@@ -1,4 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3test :: Number -> Something
5test :: Number -> Something
4test = {}
6test = {}
examples/manual/QualifiedNames.purs+2
@@ -1,5 +1,7 @@
1module Data.Either where
1module Data.Either where
2
2
3+import Prelude
4+
3data Either a b = Left a | Right b
5data Either a b = Left a | Right b
4
6
5module Main where
7module Main where
examples/manual/failing/ArgLengthMismatch.purs+4−2
@@ -1,4 +1,6 @@
1module ArgLengthMismatch where
1module ArgLengthMismatch where
2
2
3+import Prelude
4+
3− f x y = true
5+f x y = true
4− f = false
6+f = false
examples/manual/failing/ExportExplicit.purs+4−2
@@ -1,5 +1,7 @@
1-- should fail as z does not exist in the module
1-- should fail as z does not exist in the module
2module M1 (x, y, z) where
2module M1 (x, y, z) where
3
3
4+import Prelude
5+
4− x = 1
6+x = 1
5− y = 2
7+y = 2
examples/manual/failing/ExportExplicit2.purs+4−2
@@ -1,5 +1,7 @@
1-- should fail as Y is not a data constructor for X
1-- should fail as Y is not a data constructor for X
2module M1 (X(Y)) where
2module M1 (X(Y)) where
3
3
4+import Prelude
5+
4− data X = X
6+data X = X
5− data Y = Y
7+data Y = Y
examples/manual/failing/OrphanTypeDecl.purs+1−1
@@ -1,3 +1,3 @@
1module OrphanTypeDecl where
1module OrphanTypeDecl where
2
2
3− fn :: Number -> Boolean
3+fn :: Number -> Boolean
examples/manual/failing/RedefinedFixity.purs+5−3
@@ -1,6 +1,8 @@
1module RedefinedFixity where
1module RedefinedFixity where
2
2
3− (!?) x y = x + y
3+import Prelude
4
4
5+(!?) x y = x + y
6+
5− infix 2 !?
7+infix 2 !?
6− infix 2 !?
8+infix 2 !?
examples/manual/failing/RequiredHiddenType.purs+4−4
@@ -1,8 +1,8 @@
1-- exporting `a` should fail as `A` is hidden
1-- exporting `a` should fail as `A` is hidden
2module Foo (B(..), a, b) where
2module Foo (B(..), a, b) where
3
3
4− data A = A
4+data A = A
5− data B = B
5+data B = B
6
6
7− a = A
7+a = A
8− b = B
8+b = B
examples/manual/passing/ExportedInstanceDeclarations.purs+2
@@ -8,6 +8,8 @@ module ExportedInstanceDeclarations
8 , foo
8 , foo
9 ) where
9 ) where
10
10
11+import Prelude
12+
11data Const a b = Const a
13data Const a b = Const a
12
14
13class Foo a where
15class Foo a where
examples/manual/passing/TransitiveImport.purs+3
@@ -1,5 +1,7 @@
1module Test where
1module Test where
2
2
3+ import Prelude
4+
3 class TestCls a where
5 class TestCls a where
4 test :: a -> a
6 test :: a -> a
5
7
@@ -12,6 +14,7 @@ module Middle where
12
14
13module Main where
15module Main where
14
16
17+ import Prelude
15 import Middle
18 import Middle
16 import Debug.Trace
19 import Debug.Trace
17
20
examples/passing/652.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3class Foo a b
5class Foo a b
4
6
5class Bar a c
7class Bar a c
examples/passing/810.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3data Maybe a = Nothing | Just a
5data Maybe a = Nothing | Just a
4
6
5test :: forall a. Maybe a -> Maybe a
7test :: forall a. Maybe a -> Maybe a
examples/passing/ArrayType.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3class Pointed p where
5class Pointed p where
4 point :: forall a. a -> p a
6 point :: forall a. a -> p a
5
7
examples/passing/Auto.purs+9−7
@@ -1,13 +1,15 @@
1module Main where
1module Main where
2
2
3− data Auto s i o = Auto { state :: s, step :: s -> i -> o }
3+import Prelude
4
4
5− type SomeAuto i o = forall r. (forall s. Auto s i o -> r) -> r
5+data Auto s i o = Auto { state :: s, step :: s -> i -> o }
6
6
7− exists :: forall s i o. s -> (s -> i -> o) -> SomeAuto i o
7+type SomeAuto i o = forall r. (forall s. Auto s i o -> r) -> r
8− exists = \state step f -> f (Auto { state: state, step: step })
9
8
10− run :: forall i o. SomeAuto i o -> i -> o
9+exists :: forall s i o. s -> (s -> i -> o) -> SomeAuto i o
11− run = \s i -> s (\a -> case a of Auto a -> a.step a.state i)
10+exists = \state step f -> f (Auto { state: state, step: step })
12
11
12+run :: forall i o. SomeAuto i o -> i -> o
13+run = \s i -> s (\a -> case a of Auto a -> a.step a.state i)
14+
13− main = Debug.Trace.trace "Done"
15+main = Debug.Trace.trace "Done"
examples/passing/AutoPrelude.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Debug.Trace
4import Debug.Trace
4
5
5f x = x * 10.0
6f x = x * 10.0
examples/passing/AutoPrelude2.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import qualified Prelude as P
4import qualified Prelude as P
4import Debug.Trace
5import Debug.Trace
5
6
examples/passing/BindersInFunctions.purs−1
@@ -1,7 +1,6 @@
1module Main where
1module Main where
2
2
3import Prelude
3import Prelude
4−
5import Assert
4import Assert
6
5
7snd = \[_, y] -> y
6snd = \[_, y] -> y
examples/passing/BindingGroups.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3foo = bar
5foo = bar
4 where bar r = r + 1.0
6 where bar r = r + 1.0
5
7
examples/passing/BlockString.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3foo :: String
5foo :: String
4foo = """foo"""
6foo = """foo"""
5
7
examples/passing/CaseInDo.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Debug.Trace
4import Debug.Trace
4import Control.Monad.Eff
5import Control.Monad.Eff
5
6
examples/passing/CaseStatement.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3data A = A | B | C
5data A = A | B | C
4
6
5f a _ A = a
7f a _ A = a
examples/passing/CheckFunction.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3test = ((\x -> x+1.0) >>> (\x -> x*2.0)) 4.0
5test = ((\x -> x+1.0) >>> (\x -> x*2.0)) 4.0
4
6
5main = Debug.Trace.trace "Done"
7main = Debug.Trace.trace "Done"
examples/passing/CheckSynonymBug.purs+4−4
@@ -1,9 +1,9 @@
1module Main where
1module Main where
2
2
3− import Prelude
3+import Prelude
4
4
5− type Foo a = Array a
5+type Foo a = Array a
6
6
7− foo _ = length ([] :: Foo Number)
7+foo _ = length ([] :: Foo Number)
8
8
9− main = Debug.Trace.trace "Done"
9+main = Debug.Trace.trace "Done"
examples/passing/CheckTypeClass.purs+11−9
@@ -1,16 +1,18 @@
1module Main where
1module Main where
2
2
3− data Bar a = Bar
3+import Prelude
4− data Baz
5
4
6− class Foo a where
5+data Bar a = Bar
7− foo :: Bar a -> Baz
6+data Baz
8
7
9− foo_ :: forall a. (Foo a) => a -> Baz
8+class Foo a where
10− foo_ x = foo ((mkBar :: forall a. (Foo a) => a -> Bar a) x)
9+ foo :: Bar a -> Baz
11
10
12− mkBar :: forall a. a -> Bar a
11+foo_ :: forall a. (Foo a) => a -> Baz
13− mkBar _ = Bar
12+foo_ x = foo ((mkBar :: forall a. (Foo a) => a -> Bar a) x)
14
13
14+mkBar :: forall a. a -> Bar a
15+mkBar _ = Bar
16+
15− main = Debug.Trace.trace "Done"
17+main = Debug.Trace.trace "Done"
16
18
examples/passing/Church.purs+10−10
@@ -1,18 +1,18 @@
1module Main where
1module Main where
2
2
3− import Prelude ()
3+import Prelude ()
4
4
5− type List a = forall r. r -> (a -> r -> r) -> r
5+type List a = forall r. r -> (a -> r -> r) -> r
6
6
7− empty :: forall a. List a
7+empty :: forall a. List a
8− empty = \r f -> r
8+empty = \r f -> r
9
9
10− cons :: forall a. a -> List a -> List a
10+cons :: forall a. a -> List a -> List a
11− cons = \a l r f -> f a (l r f)
11+cons = \a l r f -> f a (l r f)
12
12
13− append :: forall a. List a -> List a -> List a
13+append :: forall a. List a -> List a -> List a
14− append = \l1 l2 r f -> l2 (l1 r f) f
14+append = \l1 l2 r f -> l2 (l1 r f) f
15
15
16− test = append (cons 1 empty) (cons 2 empty)
16+test = append (cons 1 empty) (cons 2 empty)
17
17
18− main = Debug.Trace.trace "Done"
18+main = Debug.Trace.trace "Done"
examples/passing/Collatz.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Control.Monad.Eff
4import Control.Monad.Eff
4import Control.Monad.ST
5import Control.Monad.ST
5
6
examples/passing/Comparisons.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Control.Monad.Eff
4import Control.Monad.Eff
4import Debug.Trace
5import Debug.Trace
5import Assert
6import Assert
examples/passing/Conditional.purs+4−4
@@ -1,9 +1,9 @@
1module Main where
1module Main where
2
2
3− import Prelude ()
3+import Prelude ()
4
4
5− fns = \f -> if f true then f else \x -> x
5+fns = \f -> if f true then f else \x -> x
6
6
7− not = \x -> if x then false else true
7+not = \x -> if x then false else true
8
8
9− main = Debug.Trace.trace "Done"
9+main = Debug.Trace.trace "Done"
examples/passing/DataAndType.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3data A = A B
5data A = A B
4
6
5type B = A
7type B = A
examples/passing/DeepArrayBinder.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Control.Monad.Eff
4import Control.Monad.Eff
4import Assert
5import Assert
5
6
examples/passing/DeepCase.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Debug.Trace
4import Debug.Trace
4import Control.Monad.Eff
5import Control.Monad.Eff
5import Control.Monad.ST
6import Control.Monad.ST
examples/passing/EmptyRow.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3data Foo r = Foo { | r }
5data Foo r = Foo { | r }
4
6
5test :: Foo ()
7test :: Foo ()
examples/passing/EqOrd.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3data Pair a b = Pair a b
5data Pair a b = Pair a b
4
6
5instance ordPair :: (Ord a, Ord b) => Ord (Pair a b) where
7instance ordPair :: (Ord a, Ord b) => Ord (Pair a b) where
examples/passing/ExtendedInfixOperators.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3comparing :: forall a b. (Ord b) => (a -> b) -> a -> a -> Ordering
5comparing :: forall a b. (Ord b) => (a -> b) -> a -> a -> Ordering
4comparing f = compare `Data.Function.on` f
6comparing f = compare `Data.Function.on` f
5
7
examples/passing/FunctionScope.purs+9−9
@@ -1,13 +1,13 @@
1module Main where
1module Main where
2
2
3− import Prelude
3+import Prelude
4− import Assert
4+import Assert
5
5
6− mkValue :: Number -> Number
6+mkValue :: Number -> Number
7− mkValue id = id
7+mkValue id = id
8
8
9− main = do
9+main = do
10− let value = mkValue 1.0
10+ let value = mkValue 1.0
11− if value == 1.0
11+ if value == 1.0
12− then Debug.Trace.trace "Done"
12+ then Debug.Trace.trace "Done"
13− else error "Not done"
13+ else error "Not done"
examples/passing/Functions.purs+7−7
@@ -1,15 +1,15 @@
1module Main where
1module Main where
2
2
3− import Prelude
3+import Prelude
4
4
5− test1 = \_ -> 0.0
5+test1 = \_ -> 0.0
6
6
7− test2 = \a b -> a + b + 1.0
7+test2 = \a b -> a + b + 1.0
8
8
9− test3 = \a -> a
9+test3 = \a -> a
10
10
11− test4 = \(%%) -> 1.0 %% 2.0
11+test4 = \(%%) -> 1.0 %% 2.0
12
12
13− test5 = \(+++) (***) -> 1.0 +++ 2.0 *** 3.0
13+test5 = \(+++) (***) -> 1.0 +++ 2.0 *** 3.0
14
14
15− main = Debug.Trace.trace "Done"
15+main = Debug.Trace.trace "Done"
examples/passing/Functions2.purs+9−9
@@ -1,13 +1,13 @@
1module Main where
1module Main where
2
2
3− import Prelude
3+import Prelude
4− import Assert
4+import Assert
5
5
6− test :: forall a b. a -> b -> a
6+test :: forall a b. a -> b -> a
7− test = \const _ -> const
7+test = \const _ -> const
8
8
9− main = do
9+main = do
10− let value = test "Done" {}
10+ let value = test "Done" {}
11− if value == "Done"
11+ if value == "Done"
12− then Debug.Trace.trace "Done"
12+ then Debug.Trace.trace "Done"
13− else error "Not done"
13+ else error "Not done"
examples/passing/Guards.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3collatz = \x -> case x of
5collatz = \x -> case x of
4 y | y % 2.0 == 0.0 -> y / 2.0
6 y | y % 2.0 == 0.0 -> y / 2.0
5 y -> y * 3.0 + 1.0
7 y -> y * 3.0 + 1.0
examples/passing/HoistError.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Control.Monad.Eff
4import Control.Monad.Eff
4import Debug.Trace
5import Debug.Trace
5import Assert
6import Assert
examples/passing/IfThenElseMaybe.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3data Maybe a = Nothing | Just a
5data Maybe a = Nothing | Just a
4
6
5test1 = if true then Just 10 else Nothing
7test1 = if true then Just 10 else Nothing
examples/passing/ImplicitEmptyImport.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3main = do
5main = do
4 Debug.Trace.trace "Hello"
6 Debug.Trace.trace "Hello"
5 Debug.Trace.trace "Goodbye"
7 Debug.Trace.trace "Goodbye"
examples/passing/InstanceBeforeClass.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3instance fooNumber :: Foo Number where
5instance fooNumber :: Foo Number where
4 foo = 0.0
6 foo = 0.0
5
7
examples/passing/IntAndChar.purs+2−1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Control.Monad.Eff
4import Control.Monad.Eff
4import Assert
5import Assert
5
6
@@ -10,7 +11,7 @@ g 'a' = 'a'
10g _ = 'b'
11g _ = 'b'
11
12
12main = do
13main = do
13− assert $ f 1 == 1
14+ assert $ f 1 == 1
14 assert $ f 0 == 0
15 assert $ f 0 == 0
15 assert $ g 'a' == 'a'
16 assert $ g 'a' == 'a'
16 assert $ g 'b' == 'b'
17 assert $ g 'b' == 'b'
examples/passing/JSReserved.purs+6−6
@@ -1,12 +1,12 @@
1module Main where
1module Main where
2
2
3− import Prelude
3+import Prelude
4
4
5− yield = 0
5+yield = 0
6− member = 1
6+member = 1
7
7
8− public = \return -> return
8+public = \return -> return
9
9
10− this catch = catch
10+this catch = catch
11
11
12− main = Debug.Trace.trace "Done"
12+main = Debug.Trace.trace "Done"
examples/passing/KindedType.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3type Star2Star f = f :: * -> *
5type Star2Star f = f :: * -> *
4
6
5type Star t = t :: *
7type Star t = t :: *
examples/passing/Let2.purs+3−1
@@ -1,6 +1,8 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3−test =
5+test =
4 let f :: Number -> Boolean
6 let f :: Number -> Boolean
5 f 0.0 = false
7 f 0.0 = false
6 f n = g (n - 1.0)
8 f n = g (n - 1.0)
examples/passing/LetInInstance.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3class Foo a where
5class Foo a where
4 foo :: a -> String
6 foo :: a -> String
5
7
examples/passing/LiberalTypeSynonyms.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3type Reader = (->) String
5type Reader = (->) String
4
6
5foo :: Reader String
7foo :: Reader String
examples/passing/Match.purs+5−3
@@ -1,7 +1,9 @@
1module Main where
1module Main where
2
2
3− data Foo a = Foo
3+import Prelude
4
4
5− foo = \f -> case f of Foo -> "foo"
5+data Foo a = Foo
6
6
7+foo = \f -> case f of Foo -> "foo"
8+
7− main = Debug.Trace.trace "Done"
9+main = Debug.Trace.trace "Done"
examples/passing/Monad.purs+21−21
@@ -1,32 +1,32 @@
1module Main where
1module Main where
2
2
3− import Prelude ()
3+import Prelude ()
4
4
5− type Monad m = { return :: forall a. a -> m a
5+type Monad m = { return :: forall a. a -> m a
6− , bind :: forall a b. m a -> (a -> m b) -> m b }
6+ , bind :: forall a b. m a -> (a -> m b) -> m b }
7
7
8− data Id a = Id a
8+data Id a = Id a
9
9
10− id :: Monad Id
10+id :: Monad Id
11− id = { return : Id
11+id = { return : Id
12− , bind : \ma f -> case ma of Id a -> f a }
12+ , bind : \ma f -> case ma of Id a -> f a }
13
13
14− data Maybe a = Nothing | Just a
14+data Maybe a = Nothing | Just a
15
15
16− maybe :: Monad Maybe
16+maybe :: Monad Maybe
17− maybe = { return : Just
17+maybe = { return : Just
18− , bind : \ma f -> case ma of
18+ , bind : \ma f -> case ma of
19− Nothing -> Nothing
19+ Nothing -> Nothing
20− Just a -> f a
20+ Just a -> f a
21− }
21+ }
22
22
23− test :: forall m. Monad m -> m Number
23+test :: forall m. Monad m -> m Number
24− test = \m -> m.bind (m.return 1.0) (\n1 ->
24+test = \m -> m.bind (m.return 1.0) (\n1 ->
25− m.bind (m.return "Test") (\n2 ->
25+ m.bind (m.return "Test") (\n2 ->
26− m.return n1))
26+ m.return n1))
27
27
28− test1 = test id
28+test1 = test id
29
29
30− test2 = test maybe
30+test2 = test maybe
31
31
32− main = Debug.Trace.trace "Done"
32+main = Debug.Trace.trace "Done"
examples/passing/MultiArgFunctions.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Data.Function
4import Data.Function
4import Control.Monad.Eff
5import Control.Monad.Eff
5import Debug.Trace
6import Debug.Trace
examples/passing/MutRec.purs+10−10
@@ -1,19 +1,19 @@
1module Main where
1module Main where
2
2
3− import Prelude
3+import Prelude
4
4
5− f 0.0 = 0.0
5+f 0.0 = 0.0
6− f x = g x + 0.0
6+f x = g x + 0.0
7
7
8− g x = f (x / 0.0)
8+g x = f (x / 0.0)
9
9
10− data Even = Zero | Even Odd
10+data Even = Zero | Even Odd
11
11
12− data Odd = Odd Even
12+data Odd = Odd Even
13
13
14− evenToNumber Zero = 0.0
14+evenToNumber Zero = 0.0
15− evenToNumber (Even n) = oddToNumber n + 0.0
15+evenToNumber (Even n) = oddToNumber n + 0.0
16
16
17− oddToNumber (Odd n) = evenToNumber n + 0.0
17+oddToNumber (Odd n) = evenToNumber n + 0.0
18
18
19− main = Debug.Trace.trace "Done"
19+main = Debug.Trace.trace "Done"
examples/passing/MutRec2.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3data A = A B
5data A = A B
4
6
5data B = B A
7data B = B A
examples/passing/MutRec3.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3data A = A B
5data A = A B
4
6
5data B = B A
7data B = B A
examples/passing/NamedPatterns.purs+6−4
@@ -1,7 +1,9 @@
1module Main where
1module Main where
2
2
3− foo = \x -> case x of
3+import Prelude
4− y@{ foo = "Foo" } -> y
5− y -> y
6
4
5+foo = \x -> case x of
6+ y@{ foo = "Foo" } -> y
7+ y -> y
8+
7− main = Debug.Trace.trace "Done"
9+main = Debug.Trace.trace "Done"
examples/passing/NegativeBinder.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3test :: Number -> Boolean
5test :: Number -> Boolean
4test -1.0 = false
6test -1.0 = false
5test _ = true
7test _ = true
examples/passing/Nested.purs+5−3
@@ -1,7 +1,9 @@
1module Main where
1module Main where
2
2
3− data Extend r a = Extend { prev :: r a, next :: a }
3+import Prelude
4
4
5− data Matrix r a = Square (r (r a)) | Bigger (Matrix (Extend r) a)
5+data Extend r a = Extend { prev :: r a, next :: a }
6
6
7+data Matrix r a = Square (r (r a)) | Bigger (Matrix (Extend r) a)
8+
7− main = Debug.Trace.trace "Done"
9+main = Debug.Trace.trace "Done"
examples/passing/NestedTypeSynonyms.purs+6−6
@@ -1,11 +1,11 @@
1module Main where
1module Main where
2
2
3− import Prelude
3+import Prelude
4
4
5− type X = String
5+type X = String
6− type Y = X -> X
6+type Y = X -> X
7
7
8− fn :: Y
8+fn :: Y
9− fn a = a
9+fn a = a
10
10
11− main = Debug.Trace.print (fn "Done")
11+main = Debug.Trace.print (fn "Done")
examples/passing/NestedWhere.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3f x = g x
5f x = g x
4 where
6 where
5 g x = go x
7 g x = go x
examples/passing/Newtype.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Control.Monad.Eff
4import Control.Monad.Eff
4import Debug.Trace
5import Debug.Trace
5
6
examples/passing/NewtypeEff.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Debug.Trace
4import Debug.Trace
4import Control.Monad.Eff
5import Control.Monad.Eff
5
6
examples/passing/NewtypeWithRecordUpdate.purs+2−1
@@ -2,12 +2,13 @@
2
2
3module Main where
3module Main where
4
4
5+import Prelude
5import Debug.Trace
6import Debug.Trace
6
7
7newtype NewType a = NewType (Object a)
8newtype NewType a = NewType (Object a)
8
9
9rec1 :: Object (a :: Number, b :: Number, c:: Number)
10rec1 :: Object (a :: Number, b :: Number, c:: Number)
10−rec1 = { a: 0.0, b: 0.0, c: 0.0 }
11+rec1 = { a: 0.0, b: 0.0, c: 0.0 }
11
12
12rec2 :: NewType (a :: Number, b :: Number, c :: Number)
13rec2 :: NewType (a :: Number, b :: Number, c :: Number)
13rec2 = NewType (rec1 { a = 1.0 })
14rec2 = NewType (rec1 { a = 1.0 })
examples/passing/ObjectGetter.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3getX = _.x
5getX = _.x
4
6
5point = { x: 1.0, y: 0.0 }
7point = { x: 1.0, y: 0.0 }
examples/passing/ObjectSynonym.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3type Inner = Number
5type Inner = Number
4
6
5inner :: Inner
7inner :: Inner
examples/passing/ObjectUpdate.purs+13−11
@@ -1,18 +1,20 @@
1module Main where
1module Main where
2
2
3− update1 = \o -> o { foo = "Foo" }
3+import Prelude
4
4
5− update2 :: forall r. { foo :: String | r } -> { foo :: String | r }
6− update2 = \o -> o { foo = "Foo" }
5+update1 = \o -> o { foo = "Foo" }
7
6
8− replace = \o -> case o of
7+update2 :: forall r. { foo :: String | r } -> { foo :: String | r }
9− { foo = "Foo" } -> o { foo = "Bar" }
8+update2 = \o -> o { foo = "Foo" }
10− { foo = "Bar" } -> o { bar = "Baz" }
11− o -> o
12
9
13− polyUpdate :: forall a r. { foo :: a | r } -> { foo :: String | r }
10+replace = \o -> case o of
14− polyUpdate = \o -> o { foo = "Foo" }
11+ { foo = "Foo" } -> o { foo = "Bar" }
12+ { foo = "Bar" } -> o { bar = "Baz" }
13+ o -> o
15
14
16− inferPolyUpdate = \o -> o { foo = "Foo" }
15+polyUpdate :: forall a r. { foo :: a | r } -> { foo :: String | r }
16+polyUpdate = \o -> o { foo = "Foo" }
17
17
18+inferPolyUpdate = \o -> o { foo = "Foo" }
19+
18− main = Debug.Trace.trace ((update1 {foo: ""}).foo)
20+main = Debug.Trace.trace ((update1 {foo: ""}).foo)
examples/passing/ObjectUpdate2.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3type X r = { | r }
5type X r = { | r }
4
6
5x :: X (baz :: String)
7x :: X (baz :: String)
examples/passing/ObjectUpdater.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Control.Monad.Eff
4import Control.Monad.Eff
4import Debug.Trace
5import Debug.Trace
5import Assert
6import Assert
examples/passing/ObjectWildcards.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Control.Monad.Eff
4import Control.Monad.Eff
4import Debug.Trace
5import Debug.Trace
5import Assert
6import Assert
examples/passing/Objects.purs+20−20
@@ -1,35 +1,35 @@
1module Main where
1module Main where
2
2
3− import Prelude
3+import Prelude
4
4
5− test = \x -> x.foo + x.bar + 1.0
5+test = \x -> x.foo + x.bar + 1.0
6
6
7− append = \o -> { foo: o.foo, bar: 1.0 }
7+append = \o -> { foo: o.foo, bar: 1.0 }
8
8
9− apTest = append({foo : "Foo", baz: "Baz"})
9+apTest = append({foo : "Foo", baz: "Baz"})
10
10
11− f = (\a -> a.b.c) { b: { c: 1.0, d: "Hello" }, e: "World" }
11+f = (\a -> a.b.c) { b: { c: 1.0, d: "Hello" }, e: "World" }
12
12
13− g = (\a -> a.f { x: 1.0, y: "y" }) { f: \o -> o.x + 1.0 }
13+g = (\a -> a.f { x: 1.0, y: "y" }) { f: \o -> o.x + 1.0 }
14
14
15− typed :: { foo :: Number }
15+typed :: { foo :: Number }
16− typed = { foo: 0.0 }
16+typed = { foo: 0.0 }
17
17
18− test2 = \x -> x."!@#"
18+test2 = \x -> x."!@#"
19
19
20− test3 = typed."foo"
20+test3 = typed."foo"
21
21
22− test4 = test2 weirdObj
22+test4 = test2 weirdObj
23− where
23+ where
24− weirdObj :: { "!@#" :: Number }
24+ weirdObj :: { "!@#" :: Number }
25− weirdObj = { "!@#": 1.0 }
25+ weirdObj = { "!@#": 1.0 }
26
26
27− test5 = case { "***": 1.0 } of
27+test5 = case { "***": 1.0 } of
28− { "***" = n } -> n
28+ { "***" = n } -> n
29
29
30− test6 = case { "***": 1.0 } of
30+test6 = case { "***": 1.0 } of
31− { "***": n } -> n
31+ { "***": n } -> n
32
32
33− test7 {a: snoog , b : blah } = blah
33+test7 {a: snoog , b : blah } = blah
34
34
35− main = Debug.Trace.trace "Done"
35+main = Debug.Trace.trace "Done"
examples/passing/OneConstructor.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3data One a = One a
5data One a = One a
4
6
5one' (One a) = a
7one' (One a) = a
examples/passing/OperatorAssociativity.purs+3−2
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Control.Monad.Eff
4import Control.Monad.Eff
4import Debug.Trace
5import Debug.Trace
5import Assert
6import Assert
@@ -17,8 +18,8 @@ main = do
17 assert (not ((negate 1.0) < 0.0) == false)
18 assert (not ((negate 1.0) < 0.0) == false)
18 assert (negate (1.0 + 10.0) == -11.0)
19 assert (negate (1.0 + 10.0) == -11.0)
19 assert (2.0 * 3.0 / 4.0 == 1.5)
20 assert (2.0 * 3.0 / 4.0 == 1.5)
20− assert (1.0 * 2.0 * 3.0 * 4.0 * 5.0 / 6.0 == 20.0)
21+ assert (1.0 * 2.0 * 3.0 * 4.0 * 5.0 / 6.0 == 20.0)
21 assert (1.0 + 10.0 - 5.0 == 6.0)
22 assert (1.0 + 10.0 - 5.0 == 6.0)
22 assert (1.0 + 10.0 * 5.0 == 51.0)
23 assert (1.0 + 10.0 * 5.0 == 51.0)
23− assert (10.0 * 5.0 - 1.0 == 49.0)
24+ assert (10.0 * 5.0 - 1.0 == 49.0)
24 trace "Success!"
25 trace "Success!"
examples/passing/OperatorInlining.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Debug.Trace
4import Debug.Trace
4
5
5main = do
6main = do
examples/passing/OperatorSections.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Assert
4import Assert
4
5
5main = do
6main = do
examples/passing/Operators.purs+68−67
@@ -1,98 +1,99 @@
1module Main where
1module Main where
2
2
3+import Prelude
3− import Control.Monad.Eff
4+import Control.Monad.Eff
4− import Debug.Trace
5+import Debug.Trace
5
6
6− (?!) :: forall a. a -> a -> a
7+(?!) :: forall a. a -> a -> a
7− (?!) x _ = x
8+(?!) x _ = x
8
9
9− bar :: String -> String -> String
10+bar :: String -> String -> String
10− bar = \s1 s2 -> s1 ++ s2
11+bar = \s1 s2 -> s1 ++ s2
11
12
12− test1 :: forall n. (Num n) => n -> n -> (n -> n -> n) -> n
13+test1 :: forall n. (Num n) => n -> n -> (n -> n -> n) -> n
13− test1 x y z = x * y + z x y
14+test1 x y z = x * y + z x y
14
15
15− test2 = (\x -> x.foo false) { foo : \_ -> 1.0 }
16+test2 = (\x -> x.foo false) { foo : \_ -> 1.0 }
16
17
17− test3 = (\x y -> x)(1.0 + 2.0 * (1.0 + 2.0)) (true && (false || false))
18+test3 = (\x y -> x)(1.0 + 2.0 * (1.0 + 2.0)) (true && (false || false))
18
19
19− k = \x -> \y -> x
20+k = \x -> \y -> x
20
21
21− test4 = 1 `k` 2
22+test4 = 1 `k` 2
22
23
23− infixl 5 %%
24+infixl 5 %%
24
25
25− (%%) :: Number -> Number -> Number
26+(%%) :: Number -> Number -> Number
26− (%%) x y = x * y + y
27+(%%) x y = x * y + y
27
28
28− test5 = 1.0 %% 2.0 %% 3.0
29+test5 = 1.0 %% 2.0 %% 3.0
29
30
30− test6 = ((\x -> x) `k` 2.0) 3.0
31+test6 = ((\x -> x) `k` 2.0) 3.0
31
32
32− (<+>) :: String -> String -> String
33+(<+>) :: String -> String -> String
33− (<+>) = \s1 s2 -> s1 ++ s2
34+(<+>) = \s1 s2 -> s1 ++ s2
34
35
35− test7 = "Hello" <+> "World!"
36+test7 = "Hello" <+> "World!"
36
37
37− (@@) :: forall a b. (a -> b) -> a -> b
38+(@@) :: forall a b. (a -> b) -> a -> b
38− (@@) = \f x -> f x
39+(@@) = \f x -> f x
39
40
40− foo :: String -> String
41+foo :: String -> String
41− foo = \s -> s
42+foo = \s -> s
42
43
43− test8 = foo @@ "Hello World"
44+test8 = foo @@ "Hello World"
44
45
45− test9 = Main.foo @@ "Hello World"
46+test9 = Main.foo @@ "Hello World"
46
47
47− test10 = "Hello" `Main.bar` "World"
48+test10 = "Hello" `Main.bar` "World"
48
49
49− (...) :: forall a. Array a -> Array a -> Array a
50+(...) :: forall a. Array a -> Array a -> Array a
50− (...) = \as -> \bs -> as
51+(...) = \as -> \bs -> as
51
52
52− test11 = [1.0, 2.0, 0.0] ... [4.0, 5.0, 6.0]
53+test11 = [1.0, 2.0, 0.0] ... [4.0, 5.0, 6.0]
53
54
54− test12 (<%>) a b = a <%> b
55+test12 (<%>) a b = a <%> b
55
56
56− test13 = \(<%>) a b -> a <%> b
57+test13 = \(<%>) a b -> a <%> b
57
58
58− test14 :: Number -> Number -> Boolean
59+test14 :: Number -> Number -> Boolean
59− test14 a b = a < b
60+test14 a b = a < b
60
61
61− test15 :: Number -> Number -> Boolean
62+test15 :: Number -> Number -> Boolean
62− test15 a b = const false $ a `test14` b
63+test15 a b = const false $ a `test14` b
63
64
64− test17 :: Number
65+test17 :: Number
65− test17 = negate (-1.0)
66+test17 = negate (-1.0)
66
67
67− test18 :: Number
68+test18 :: Number
68− test18 = negate $ negate 1.0
69+test18 = negate $ negate 1.0
69
70
70− test19 :: Number
71+test19 :: Number
71− test19 = negate $ negate (-1.0)
72+test19 = negate $ negate (-1.0)
72
73
73− test20 :: Number
74+test20 :: Number
74− test20 = 1.0 @ 2.0
75+test20 = 1.0 @ 2.0
75− where
76+ where
76− (@) x y = x + y * y
77+ (@) x y = x + y * y
77
78
78− main = do
79+main = do
79− let t1 = test1 1.0 2.0 (\x y -> x + y)
80+ let t1 = test1 1.0 2.0 (\x y -> x + y)
80− let t2 = test2
81+ let t2 = test2
81− let t3 = test3
82+ let t3 = test3
82− let t4 = test4
83+ let t4 = test4
83− let t5 = test5
84+ let t5 = test5
84− let t6 = test6
85+ let t6 = test6
85− let t7 = test7
86+ let t7 = test7
86− let t8 = test8
87+ let t8 = test8
87− let t9 = test9
88+ let t9 = test9
88− let t10 = test10
89+ let t10 = test10
89− let t11 = test11
90+ let t11 = test11
90− let t12 = test12 k 1.0 2.0
91+ let t12 = test12 k 1.0 2.0
91− let t13 = test13 k 1.0 2.0
92+ let t13 = test13 k 1.0 2.0
92− let t14 = test14 1.0 2.0
93+ let t14 = test14 1.0 2.0
93− let t15 = test15 1.0 2.0
94+ let t15 = test15 1.0 2.0
94− let t17 = test17
95+ let t17 = test17
95− let t18 = test18
96+ let t18 = test18
96− let t19 = test19
97+ let t19 = test19
97− let t20 = test20
98+ let t20 = test20
98− trace "Done"
99+ trace "Done"
examples/passing/PartialFunction.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Assert
4import Assert
4
5
5fn :: Number -> Number
6fn :: Number -> Number
examples/passing/Patterns.purs+15−15
@@ -1,22 +1,22 @@
1module Main where
1module Main where
2
2
3− import Prelude
3+import Prelude
4
4
5− test = \x -> case x of
5+test = \x -> case x of
6− { str = "Foo", bool = true } -> true
6+ { str = "Foo", bool = true } -> true
7− { str = "Bar", bool = b } -> b
7+ { str = "Bar", bool = b } -> b
8− _ -> false
8+ _ -> false
9
9
10− f = \o -> case o of
10+f = \o -> case o of
11− { foo = "Foo" } -> o.bar
11+ { foo = "Foo" } -> o.bar
12− _ -> 0
12+ _ -> 0
13
13
14− h = \o -> case o of
14+h = \o -> case o of
15− a@[_,_,_] -> a
15+ a@[_,_,_] -> a
16− _ -> []
16+ _ -> []
17
17
18− isDesc :: Array Number -> Boolean
18+isDesc :: Array Number -> Boolean
19− isDesc [x, y] | x > y = true
19+isDesc [x, y] | x > y = true
20− isDesc _ = false
20+isDesc _ = false
21
21
22− main = Debug.Trace.trace "Done"
22+main = Debug.Trace.trace "Done"
examples/passing/Person.purs+7−5
@@ -1,9 +1,11 @@
1module Main where
1module Main where
2
2
3− data Person = Person { name :: String, age :: Number }
3+import Prelude
4
4
5− showPerson :: Person -> String
6− showPerson = \p -> case p of
7− Person o -> o.name ++ ", aged " ++ show o.age
5+data Person = Person { name :: String, age :: Number }
8
6
7+showPerson :: Person -> String
8+showPerson = \p -> case p of
9+ Person o -> o.name ++ ", aged " ++ show o.age
10+
9− main = Debug.Trace.trace "Done"
11+main = Debug.Trace.trace "Done"
examples/passing/Rank2Data.purs+18−18
@@ -1,29 +1,29 @@
1module Main where
1module Main where
2
2
3− import Prelude
3+import Prelude
4
4
5− data Id = Id forall a. a -> a
5+data Id = Id forall a. a -> a
6
6
7− runId = \id a -> case id of
7+runId = \id a -> case id of
8− Id f -> f a
8+ Id f -> f a
9
9
10− data Nat = Nat forall r. r -> (r -> r) -> r
10+data Nat = Nat forall r. r -> (r -> r) -> r
11
11
12− runNat = \nat -> case nat of
12+runNat = \nat -> case nat of
13− Nat f -> f 0.0 (\n -> n + 1.0)
13+ Nat f -> f 0.0 (\n -> n + 1.0)
14
14
15− zero' = Nat (\zero' _ -> zero')
15+zero' = Nat (\zero' _ -> zero')
16
16
17− succ = \n -> case n of
17+succ = \n -> case n of
18− Nat f -> Nat (\zero' succ -> succ (f zero' succ))
18+ Nat f -> Nat (\zero' succ -> succ (f zero' succ))
19
19
20− add = \n m -> case n of
20+add = \n m -> case n of
21− Nat f -> case m of
21+ Nat f -> case m of
22− Nat g -> Nat (\zero' succ -> g (f zero' succ) succ)
22+ Nat g -> Nat (\zero' succ -> g (f zero' succ) succ)
23
23
24− one' = succ zero'
24+one' = succ zero'
25− two = succ zero'
25+two = succ zero'
26− four = add two two
26+four = add two two
27− fourNumber = runNat four
27+fourNumber = runNat four
28
28
29− main = Debug.Trace.trace "Done'"
29+main = Debug.Trace.trace "Done'"
examples/passing/Rank2Object.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Debug.Trace
4import Debug.Trace
4
5
5data Foo = Foo { id :: forall a. a -> a }
6data Foo = Foo { id :: forall a. a -> a }
examples/passing/Rank2TypeSynonym.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Control.Monad.Eff
4import Control.Monad.Eff
4
5
5type Foo a = forall f. (Monad f) => f a
6type Foo a = forall f. (Monad f) => f a
examples/passing/Rank2Types.purs+6−6
@@ -1,11 +1,11 @@
1module Main where
1module Main where
2
2
3− import Prelude
3+import Prelude
4
4
5− test1 :: (forall a. (a -> a)) -> Number
5+test1 :: (forall a. (a -> a)) -> Number
6− test1 = \f -> f 0.0
6+test1 = \f -> f 0.0
7
7
8− forever :: forall m a b. (forall a b. m a -> (a -> m b) -> m b) -> m a -> m b
8+forever :: forall m a b. (forall a b. m a -> (a -> m b) -> m b) -> m a -> m b
9− forever = \bind action -> bind action $ \_ -> forever bind action
9+forever = \bind action -> bind action $ \_ -> forever bind action
10
10
11− main = Debug.Trace.trace "Done"
11+main = Debug.Trace.trace "Done"
examples/passing/RebindableSyntax.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3example1 :: String
5example1 :: String
4example1 = do
6example1 = do
5 "Do"
7 "Do"
examples/passing/Recursion.purs+6−6
@@ -1,10 +1,10 @@
1module Main where
1module Main where
2
2
3− import Prelude
3+import Prelude
4
4
5− fib = \n -> case n of
5+fib = \n -> case n of
6− 0.0 -> 1.0
6+ 0.0 -> 1.0
7− 1.0 -> 1.0
7+ 1.0 -> 1.0
8− n -> fib (n - 1.0) + fib (n - 2.0)
8+ n -> fib (n - 1.0) + fib (n - 2.0)
9
9
10− main = Debug.Trace.trace "Done"
10+main = Debug.Trace.trace "Done"
examples/passing/ReservedWords.purs+9−7
@@ -1,13 +1,15 @@
1-- See https://github.com/purescript/purescript/issues/606
1-- See https://github.com/purescript/purescript/issues/606
2module Main where
2module Main where
3
3
4− o :: { type :: String }
4+import Prelude
5− o = { type: "o" }
6
5
7− p :: { type :: String }
6+o :: { type :: String }
8− p = o { type = "p" }
7+o = { type: "o" }
9
8
10− f :: forall r. { type :: String | r } -> String
9+p :: { type :: String }
11− f { type = "p" } = "Done"
10+p = o { type = "p" }
12
11
12+f :: forall r. { type :: String | r } -> String
13+f { type = "p" } = "Done"
14+
13− main = Debug.Trace.trace $ f { type: p.type, foo: "bar" }
15+main = Debug.Trace.trace $ f { type: p.type, foo: "bar" }
examples/passing/RowConstructors.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3type Foo = (x :: Number | (y :: Number | (z :: Number)))
5type Foo = (x :: Number | (y :: Number | (z :: Number)))
4type Bar = (x :: Number, y :: Number, z :: Number)
6type Bar = (x :: Number, y :: Number, z :: Number)
5type Baz = { w :: Number | Bar }
7type Baz = { w :: Number | Bar }
examples/passing/RowPolyInstanceContext.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3class T s m where
5class T s m where
4 state :: (s -> s) -> m Unit
6 state :: (s -> s) -> m Unit
5
7
examples/passing/ScopedTypeVariables.purs+3−1
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3test1 :: forall a. (a -> a) -> a -> a
5test1 :: forall a. (a -> a) -> a -> a
4test1 f x = g (g x)
6test1 f x = g (g x)
5 where
7 where
@@ -15,7 +17,7 @@ test2 = h
15 g :: b -> b
17 g :: b -> b
16 g y = f (f y)
18 g y = f (f y)
17
19
18−test3 :: Number
20+test3 :: Number
19test3 = ((\b -> b :: b) :: forall b. b -> b) 0.0
21test3 = ((\b -> b :: b) :: forall b. b -> b) 0.0
20
22
21test4 :: forall a. (a -> a) -> a -> a
23test4 :: forall a. (a -> a) -> a -> a
examples/passing/Sequence.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Control.Monad.Eff
4import Control.Monad.Eff
4
5
5data List a = Cons a (List a) | Nil
6data List a = Cons a (List a) | Nil
examples/passing/SequenceDesugared.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Control.Monad.Eff
4import Control.Monad.Eff
4
5
5data List a = Cons a (List a) | Nil
6data List a = Cons a (List a) | Nil
examples/passing/ShadowedRename.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Control.Monad.Eff
4import Control.Monad.Eff
4import Debug.Trace
5import Debug.Trace
5import Assert
6import Assert
examples/passing/ShadowedTCO.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3runNat f = f 0.0 (\n -> n + 1.0)
5runNat f = f 0.0 (\n -> n + 1.0)
4
6
5zero' z _ = z
7zero' z _ = z
examples/passing/ShadowedTCOLet.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3f x y z =
5f x y z =
4 let f 1.0 2.0 3.0 = 1.0
6 let f 1.0 2.0 3.0 = 1.0
5 in f x z y
7 in f x z y
examples/passing/SignedNumericLiterals.purs+12−10
@@ -1,15 +1,17 @@
1module Main where
1module Main where
2
2
3− p = 0.5
3+import Prelude
4− q = 1.0
5− x = -1.0
6− y = -0.5
7− z = 0.5
8− w = 1.0
9
4
10− f :: Number -> Number
5+p = 0.5
11− f x = -x
6+q = 1.0
7+x = -1.0
8+y = -0.5
9+z = 0.5
10+w = 1.0
12
11
13− test1 = 2.0 - 1.0
12+f :: Number -> Number
13+f x = -x
14
14
15+test1 = 2.0 - 1.0
16+
15− main = Debug.Trace.trace "Done"
17+main = Debug.Trace.trace "Done"
examples/passing/Superclasses1.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3class Su a where
5class Su a where
4 su :: a -> a
6 su :: a -> a
5
7
examples/passing/Superclasses2.purs+1
@@ -1,5 +1,6 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Prelude.Unsafe (unsafeIndex)
4import Prelude.Unsafe (unsafeIndex)
4
5
5class Su a where
6class Su a where
examples/passing/Superclasses3.purs+1−1
@@ -1,7 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
3import Debug.Trace
4import Debug.Trace
4−
5import Control.Monad.Eff
5import Control.Monad.Eff
6
6
7class (Monad m) <= MonadWriter w m where
7class (Monad m) <= MonadWriter w m where
examples/passing/TCOCase.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3data Data = One | More Data
5data Data = One | More Data
4
6
5main = Debug.Trace.trace (from (to 10000.0 One))
7main = Debug.Trace.trace (from (to 10000.0 One))
examples/passing/Tick.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3test' x = x
5test' x = x
4
6
5main = Debug.Trace.trace "Done"
7main = Debug.Trace.trace "Done"
examples/passing/TopLevelCase.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3gcd :: Number -> Number -> Number
5gcd :: Number -> Number -> Number
4gcd 0.0 x = x
6gcd 0.0 x = x
5gcd x 0.0 = x
7gcd x 0.0 = x
examples/passing/TypeClassMemberOrderChange.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3class Test a where
5class Test a where
4 fn :: a -> a -> a
6 fn :: a -> a -> a
5 val :: a
7 val :: a
examples/passing/TypeClassesWithOverlappingTypeVariables.purs+6−6
@@ -1,11 +1,11 @@
1module Main where
1module Main where
2
2
3− import Prelude
3+import Prelude
4
4
5− data Either a b = Left a | Right b
5+data Either a b = Left a | Right b
6
6
7− instance functorEither :: Prelude.Functor (Either a) where
7+instance functorEither :: Prelude.Functor (Either a) where
8− (<$>) _ (Left x) = Left x
8+ (<$>) _ (Left x) = Left x
9− (<$>) f (Right y) = Right (f y)
9+ (<$>) f (Right y) = Right (f y)
10
10
11− main = Debug.Trace.trace "Done"
11+main = Debug.Trace.trace "Done"
examples/passing/TypeDecl.purs+7−7
@@ -1,12 +1,12 @@
1module Main where
1module Main where
2
2
3− import Prelude
3+import Prelude
4
4
5− k :: String -> Number -> String
5+k :: String -> Number -> String
6− k x y = x
6+k x y = x
7
7
8− iterate :: forall a. Number -> (a -> a) -> a -> a
8+iterate :: forall a. Number -> (a -> a) -> a -> a
9− iterate 0.0 f a = a
9+iterate 0.0 f a = a
10− iterate n f a = iterate (n - 1.0) f (f a)
10+iterate n f a = iterate (n - 1.0) f (f a)
11
11
12− main = Debug.Trace.trace "Done"
12+main = Debug.Trace.trace "Done"
examples/passing/TypeSynonymInData.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3type A a = Array a
5type A a = Array a
4
6
5data Foo a = Foo (A a) | Bar
7data Foo a = Foo (A a) | Bar
examples/passing/TypeSynonyms.purs+20−18
@@ -1,25 +1,27 @@
1module Main where
1module Main where
2
2
3− type Lens a b =
3+import Prelude
4− { get :: a -> b
5− , set :: a -> b -> a
6− }
7
4
8− composeLenses :: forall a b c. Lens a b -> Lens b c -> Lens a c
5+type Lens a b =
9− composeLenses = \l1 -> \l2 ->
10− { get: \a -> l2.get (l1.get a)
6+ { get :: a -> b
11− , set: \a c -> l1.set a (l2.set (l1.get a) c)
7+ , set :: a -> b -> a
12− }
8+ }
13
9
14− type Pair a b = { fst :: a, snd :: b }
10+composeLenses :: forall a b c. Lens a b -> Lens b c -> Lens a c
11+composeLenses = \l1 -> \l2 ->
12+ { get: \a -> l2.get (l1.get a)
13+ , set: \a c -> l1.set a (l2.set (l1.get a) c)
14+ }
15
15
16− fst :: forall a b. Lens (Pair a b) a
17− fst =
18− { get: \p -> p.fst
19− , set: \p a -> { fst: a, snd: p.snd }
16+type Pair a b = { fst :: a, snd :: b }
20− }
21
17
22− test1 :: forall a b c. Lens (Pair (Pair a b) c) a
18+fst :: forall a b. Lens (Pair a b) a
23− test1 = composeLenses fst fst
19+fst =
20+ { get: \p -> p.fst
21+ , set: \p a -> { fst: a, snd: p.snd }
22+ }
24
23
24+test1 :: forall a b c. Lens (Pair (Pair a b) c) a
25+test1 = composeLenses fst fst
26+
25− main = Debug.Trace.trace "Done"
27+main = Debug.Trace.trace "Done"
examples/passing/TypeWildcards.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3testTopLevel :: _ -> _
5testTopLevel :: _ -> _
4testTopLevel n = n + 1.0
6testTopLevel n = n + 1.0
5
7
examples/passing/TypeWildcardsRecordExtension.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3foo :: forall a. {b :: Number | a} -> {b :: Number | _}
5foo :: forall a. {b :: Number | a} -> {b :: Number | _}
4foo f = f
6foo f = f
5
7
examples/passing/TypedWhere.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3data E a b = L a | R b
5data E a b = L a | R b
4
6
5data L a = C a (L a) | N
7data L a = C a (L a) | N
examples/passing/UnderscoreIdent.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3data Data_type = Con_Structor | Con_2 String
5data Data_type = Con_Structor | Con_2 String
4
6
5type Type_name = Data_type
7type Type_name = Data_type
examples/passing/UnknownInTypeClassLookup.purs+2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3+import Prelude
4+
3class EQ a b
5class EQ a b
4
6
5instance eqAA :: EQ a a
7instance eqAA :: EQ a a
examples/passing/iota.purs+4−4
@@ -1,9 +1,9 @@
1module Main where
1module Main where
2
2
3− s = \x -> \y -> \z -> x z (y z)
3+s = \x -> \y -> \z -> x z (y z)
4
4
5− k = \x -> \y -> x
5+k = \x -> \y -> x
6
6
7− iota = \x -> x s k
7+iota = \x -> x s k
8
8
9− main = Debug.Trace.trace "Done"
9+main = Debug.Trace.trace "Done"
examples/passing/s.purs+4−2
@@ -1,5 +1,7 @@
1module Main where
1module Main where
2
2
3− s = \x y z -> x z (y z)
3+import Prelude
4
4
5+s = \x y z -> x z (y z)
6+
5− main = Debug.Trace.trace "Done"
7+main = Debug.Trace.trace "Done"
psc-make/Main.hs+3−10
@@ -46,13 +46,12 @@ data PSCMakeOptions = PSCMakeOptions
46 }
46 }
47
47
48data InputOptions = InputOptions
48data InputOptions = InputOptions
49− { ioNoPrelude :: Bool
50− , ioInputFiles :: [FilePath]
49+ { ioInputFiles :: [FilePath]
51 }
50 }
52
51
53compile :: PSCMakeOptions -> IO ()
52compile :: PSCMakeOptions -> IO ()
54compile (PSCMakeOptions input inputForeign outputDir opts usePrefix) = do
53compile (PSCMakeOptions input inputForeign outputDir opts usePrefix) = do
55− moduleFiles <- readInput (InputOptions (P.optionsNoPrelude opts) input)
54+ moduleFiles <- readInput (InputOptions input)
56 foreignFiles <- forM inputForeign (\inFile -> (inFile,) <$> readFile inFile)
55 foreignFiles <- forM inputForeign (\inFile -> (inFile,) <$> readFile inFile)
57 case runWriterT (parseInputs moduleFiles foreignFiles) of
56 case runWriterT (parseInputs moduleFiles foreignFiles) of
58 Left errs -> do
57 Left errs -> do
@@ -108,11 +107,6 @@ noTco = switch $
108 long "no-tco"
107 long "no-tco"
109 <> help "Disable tail call optimizations"
108 <> help "Disable tail call optimizations"
110
109
111−noPrelude :: Parser Bool
112−noPrelude = switch $
113− long "no-prelude"
114− <> help "Omit the automatic Prelude import"
115−
116noMagicDo :: Parser Bool
110noMagicDo :: Parser Bool
117noMagicDo = switch $
111noMagicDo = switch $
118 long "no-magic-do"
112 long "no-magic-do"
@@ -143,8 +137,7 @@ noPrefix = switch $
143
137
144
138
145options :: Parser (P.Options P.Make)
139options :: Parser (P.Options P.Make)
146−options = P.Options <$> noPrelude
140+options = P.Options <$> noTco
147− <*> noTco
148 <*> noMagicDo
141 <*> noMagicDo
149 <*> pure Nothing
142 <*> pure Nothing
150 <*> noOpts
143 <*> noOpts
psc/Main.hs+3−10
@@ -51,8 +51,7 @@ data PSCOptions = PSCOptions
51 }
51 }
52
52
53data InputOptions = InputOptions
53data InputOptions = InputOptions
54− { ioNoPrelude :: Bool
55− , ioUseStdIn :: Bool
54+ { ioUseStdIn :: Bool
56 , ioInputFiles :: [FilePath]
55 , ioInputFiles :: [FilePath]
57 }
56 }
58
57
@@ -69,7 +68,7 @@ runPSC opts rwe = runWriterT (runReaderT rwe opts)
69compile :: PSCOptions -> IO ()
68compile :: PSCOptions -> IO ()
70compile (PSCOptions input inputForeign opts stdin output externs usePrefix) = do
69compile (PSCOptions input inputForeign opts stdin output externs usePrefix) = do
71 let prefix = ["Generated by psc version " ++ showVersion Paths.version | usePrefix]
70 let prefix = ["Generated by psc version " ++ showVersion Paths.version | usePrefix]
72− moduleFiles <- readInput (InputOptions (P.optionsNoPrelude opts) stdin input)
71+ moduleFiles <- readInput (InputOptions stdin input)
73 foreignFiles <- forM inputForeign (\inFile -> (inFile,) <$> readFile inFile)
72 foreignFiles <- forM inputForeign (\inFile -> (inFile,) <$> readFile inFile)
74 case runWriterT (parseInputs moduleFiles foreignFiles) of
73 case runWriterT (parseInputs moduleFiles foreignFiles) of
75 Left errs -> do
74 Left errs -> do
@@ -153,11 +152,6 @@ noTco = switch $
153 long "no-tco"
152 long "no-tco"
154 <> help "Disable tail call optimizations"
153 <> help "Disable tail call optimizations"
155
154
156−noPrelude :: Parser Bool
157−noPrelude = switch $
158− long "no-prelude"
159− <> help "Omit the automatic Prelude import"
160−
161comments :: Parser Bool
155comments :: Parser Bool
162comments = switch $
156comments = switch $
163 short 'c'
157 short 'c'
@@ -200,8 +194,7 @@ noPrefix = switch $
200 <> help "Do not include comment header"
194 <> help "Do not include comment header"
201
195
202options :: Parser (P.Options P.Compile)
196options :: Parser (P.Options P.Compile)
203−options = P.Options <$> noPrelude
197+options = P.Options <$> noTco
204− <*> noTco
205 <*> noMagicDo
198 <*> noMagicDo
206 <*> runMain
199 <*> runMain
207 <*> noOpts
200 <*> noOpts
psci/Make.hs+2−2
@@ -43,7 +43,7 @@ import qualified Language.PureScript.CoreFn as CF
43import IO (mkdirp)
43import IO (mkdirp)
44
44
45options :: P.Options P.Make
45options :: P.Options P.Make
46−options = P.Options False False False Nothing False False False P.MakeOptions
46+options = P.Options False False Nothing False False False P.MakeOptions
47
47
48modulesDir :: FilePath
48modulesDir :: FilePath
49modulesDir = ".psci_modules" ++ pathSeparator : "node_modules"
49modulesDir = ".psci_modules" ++ pathSeparator : "node_modules"
@@ -92,7 +92,7 @@ buildMakeActions filePathMap foreigns =
92 codegen m _ nextVar exts = do
92 codegen m _ nextVar exts = do
93 let mn = CF.moduleName m
93 let mn = CF.moduleName m
94 foreignInclude <- case CF.moduleName m `M.lookup` foreigns of
94 foreignInclude <- case CF.moduleName m `M.lookup` foreigns of
95− Just path
95+ Just path
96 | not $ requiresForeign m -> do tell $ P.errorMessage $ P.UnnecessaryFFIModule mn path
96 | not $ requiresForeign m -> do tell $ P.errorMessage $ P.UnnecessaryFFIModule mn path
97 return Nothing
97 return Nothing
98 | otherwise -> return $ Just $ J.JSApp (J.JSVar "require") [J.JSStringLiteral "./foreign"]
98 | otherwise -> return $ Just $ J.JSApp (J.JSVar "require") [J.JSStringLiteral "./foreign"]
psci/PSCi.hs+3−9
@@ -88,12 +88,6 @@ supportModule =
88
88
89-- File helpers
89-- File helpers
90
90
91−-- |
92−-- Load the necessary modules.
93−--
94−defaultImports :: [ImportedModule]
95−defaultImports = [(P.ModuleName [P.ProperName "Prelude"], P.Implicit, Nothing)]
96−
97-- |
91-- |
98-- Locates the node executable.
92-- Locates the node executable.
99-- Checks for either @nodejs@ or @node@.
93-- Checks for either @nodejs@ or @node@.
@@ -121,7 +115,7 @@ loadModule filename = do
121 return $ either (Left . P.prettyPrintMultipleErrors False) (Right . map snd) $ P.parseModulesFromFiles id [(filename, content)]
115 return $ either (Left . P.prettyPrintMultipleErrors False) (Right . map snd) $ P.parseModulesFromFiles id [(filename, content)]
122
116
123-- |
117-- |
124−-- Load all modules, including the Prelude
118+-- Load all modules.
125--
119--
126loadAllModules :: [FilePath] -> IO (Either P.MultipleErrors [(Either P.RebuildPolicy FilePath, P.Module)])
120loadAllModules :: [FilePath] -> IO (Either P.MultipleErrors [(Either P.RebuildPolicy FilePath, P.Module)])
127loadAllModules files = do
121loadAllModules files = do
@@ -452,7 +446,7 @@ handleCommand ResetState = do
452 files <- psciImportedFilenames <$> PSCI (lift get)
446 files <- psciImportedFilenames <$> PSCI (lift get)
453 PSCI . lift . modify $ \st -> st
447 PSCI . lift . modify $ \st -> st
454 { psciImportedFilenames = files
448 { psciImportedFilenames = files
455− , psciImportedModules = defaultImports
449+ , psciImportedModules = []
456 , psciLetBindings = []
450 , psciLetBindings = []
457 }
451 }
458 loadAllImportedModules
452 loadAllImportedModules
@@ -498,7 +492,7 @@ loop PSCiOptions{..} = do
498 case foreignsOrError of
492 case foreignsOrError of
499 Left errs -> putStrLn (P.prettyPrintMultipleErrors False errs) >> exitFailure
493 Left errs -> putStrLn (P.prettyPrintMultipleErrors False errs) >> exitFailure
500 Right foreigns ->
494 Right foreigns ->
501− flip evalStateT (PSCiState psciInputFile defaultImports modules foreigns [] psciInputNodeFlags) . runInputT (setComplete completion settings) $ do
495+ flip evalStateT (PSCiState psciInputFile [] modules foreigns [] psciInputNodeFlags) . runInputT (setComplete completion settings) $ do
502 outputStrLn prologueMessage
496 outputStrLn prologueMessage
503 traverse_ (mapM_ (runPSCI . handleCommand)) config
497 traverse_ (mapM_ (runPSCI . handleCommand)) config
504 unless (consoleIsDefined (map snd modules)) . outputStrLn $ unlines
498 unless (consoleIsDefined (map snd modules)) . outputStrLn $ unlines
psci/tests/Main.hs+1−1
@@ -141,7 +141,7 @@ getPSCiState = do
141 Left err ->
141 Left err ->
142 print err >> exitFailure
142 print err >> exitFailure
143 Right modules ->
143 Right modules ->
144− let imports = controlMonadSTasST : defaultImports
144+ let imports = [controlMonadSTasST, (P.ModuleName [P.ProperName "Prelude"], P.Implicit, Nothing)]
145 in return (PSCiState [] imports modules foreigns [] [])
145 in return (PSCiState [] imports modules foreigns [] [])
146
146
147controlMonadSTasST :: ImportedModule
147controlMonadSTasST :: ImportedModule
src/Language/PureScript.hs+2−18
@@ -97,11 +97,9 @@ compile = compile' initEnvironment
97compile' :: (Functor m, Applicative m, MonadError MultipleErrors m, MonadWriter MultipleErrors m, MonadReader (Options Compile) m)
97compile' :: (Functor m, Applicative m, MonadError MultipleErrors m, MonadWriter MultipleErrors m, MonadReader (Options Compile) m)
98 => Environment -> [Module] -> m ([CoreFn.Module CoreFn.Ann], Environment, SupplyVar, Externs)
98 => Environment -> [Module] -> m ([CoreFn.Module CoreFn.Ann], Environment, SupplyVar, Externs)
99compile' env ms = do
99compile' env ms = do
100− noPrelude <- asks optionsNoPrelude
101− unless noPrelude (checkPreludeIsDefined ms)
102 additional <- asks optionsAdditional
100 additional <- asks optionsAdditional
103 mainModuleIdent <- asks (fmap moduleNameFromString . optionsMain)
101 mainModuleIdent <- asks (fmap moduleNameFromString . optionsMain)
104− (sorted, _) <- sortModules $ map importPrim $ if noPrelude then ms else map importPrelude ms
102+ (sorted, _) <- sortModules $ map importPrim ms
105 mapM_ lint sorted
103 mapM_ lint sorted
106 (desugared, nextVar) <- runSupplyT 0 $ desugar sorted
104 (desugared, nextVar) <- runSupplyT 0 $ desugar sorted
107 (elaborated, env') <- runCheck' env $ forM desugared $ typeCheckModule mainModuleIdent
105 (elaborated, env') <- runCheck' env $ forM desugared $ typeCheckModule mainModuleIdent
@@ -219,9 +217,7 @@ make :: forall m. (Functor m, Applicative m, Monad m, MonadReader (P.Options P.M
219 -> [(Either RebuildPolicy FilePath, Module)]
217 -> [(Either RebuildPolicy FilePath, Module)]
220 -> m Environment
218 -> m Environment
221make MakeActions{..} ms = do
219make MakeActions{..} ms = do
222− noPrelude <- asks optionsNoPrelude
223− unless noPrelude (checkPreludeIsDefined (map snd ms))
224− (sorted, graph) <- sortModules $ map importPrim $ if noPrelude then map snd ms else map (importPrelude . snd) ms
220+ (sorted, graph) <- sortModules $ map (importPrim . snd) ms
225 mapM_ lint sorted
221 mapM_ lint sorted
226 toRebuild <- foldM (\s (Module _ moduleName' _ _) -> do
222 toRebuild <- foldM (\s (Module _ moduleName' _ _) -> do
227 inputTimestamp <- getInputTimestamp moduleName'
223 inputTimestamp <- getInputTimestamp moduleName'
@@ -271,12 +267,6 @@ make MakeActions{..} ms = do
271 SimpleErrorWrapper (ErrorParsingModule err) -> SimpleErrorWrapper (ErrorParsingExterns err)
267 SimpleErrorWrapper (ErrorParsingModule err) -> SimpleErrorWrapper (ErrorParsingExterns err)
272 _ -> e
268 _ -> e
273
269
274−checkPreludeIsDefined :: (MonadWriter MultipleErrors m) => [Module] -> m ()
275−checkPreludeIsDefined ms = do
276− let mns = map getModuleName ms
277− unless (preludeModuleName `elem` mns) $
278− tell (errorMessage PreludeNotPresent)
279−
280reverseDependencies :: ModuleGraph -> M.Map ModuleName [ModuleName]
270reverseDependencies :: ModuleGraph -> M.Map ModuleName [ModuleName]
281reverseDependencies g = combine [ (dep, mn) | (mn, deps) <- g, dep <- deps ]
271reverseDependencies g = combine [ (dep, mn) | (mn, deps) <- g, dep <- deps ]
282 where
272 where
@@ -298,11 +288,5 @@ addDefaultImport toImport m@(Module coms mn decls exps) =
298importPrim :: Module -> Module
288importPrim :: Module -> Module
299importPrim = addDefaultImport (ModuleName [ProperName C.prim])
289importPrim = addDefaultImport (ModuleName [ProperName C.prim])
300
290
301−preludeModuleName :: ModuleName
302−preludeModuleName = ModuleName [ProperName C.prelude]
303−
304−importPrelude :: Module -> Module
305−importPrelude = addDefaultImport preludeModuleName
306−
307version :: Version
291version :: Version
308version = Paths.version
292version = Paths.version
src/Language/PureScript/Docs/ParseAndDesugar.hs+1−4
@@ -57,7 +57,7 @@ parseAndDesugar inputFiles depsFiles callback = do
57 ms <- throwLeft ParseError eParsed
57 ms <- throwLeft ParseError eParsed
58
58
59 let depsModules = getDepsModuleNames (map (\(fp, m) -> (,m) <$> fp) ms)
59 let depsModules = getDepsModuleNames (map (\(fp, m) -> (,m) <$> fp) ms)
60− let eSorted = P.sortModules . map (importPrim . importPrelude . snd) $ ms
60+ let eSorted = P.sortModules . map (importPrim . snd) $ ms
61 (ms', _) <- throwLeft SortModulesError eSorted
61 (ms', _) <- throwLeft SortModulesError eSorted
62
62
63 modules <- throwLeft DesugarError (desugar ms')
63 modules <- throwLeft DesugarError (desugar ms')
@@ -93,9 +93,6 @@ addDefaultImport toImport m@(P.Module coms mn decls exps) =
93importPrim :: P.Module -> P.Module
93importPrim :: P.Module -> P.Module
94importPrim = addDefaultImport (P.ModuleName [P.ProperName C.prim])
94importPrim = addDefaultImport (P.ModuleName [P.ProperName C.prim])
95
95
96−importPrelude :: P.Module -> P.Module
97−importPrelude = addDefaultImport (P.ModuleName [P.ProperName C.prelude])
98−
99desugar :: [P.Module] -> Either P.MultipleErrors [P.Module]
96desugar :: [P.Module] -> Either P.MultipleErrors [P.Module]
100desugar = P.evalSupplyT 0 . desugar'
97desugar = P.evalSupplyT 0 . desugar'
101 where
98 where
src/Language/PureScript/Errors.hs−12
@@ -52,7 +52,6 @@ import qualified Text.Parsec as P
52data SimpleErrorMessage
52data SimpleErrorMessage
53 = ErrorParsingExterns P.ParseError
53 = ErrorParsingExterns P.ParseError
54 | ErrorParsingFFIModule FilePath
54 | ErrorParsingFFIModule FilePath
55− | ErrorParsingPrelude P.ParseError
56 | ErrorParsingModule P.ParseError
55 | ErrorParsingModule P.ParseError
57 | MissingFFIModule ModuleName
56 | MissingFFIModule ModuleName
58 | MultipleFFIModules ModuleName [FilePath]
57 | MultipleFFIModules ModuleName [FilePath]
@@ -120,7 +119,6 @@ data SimpleErrorMessage
120 | TransitiveExportError DeclarationRef [DeclarationRef]
119 | TransitiveExportError DeclarationRef [DeclarationRef]
121 | ShadowedName Ident
120 | ShadowedName Ident
122 | WildcardInferredType Type
121 | WildcardInferredType Type
123− | PreludeNotPresent
124 deriving (Show)
122 deriving (Show)
125
123
126-- |
124-- |
@@ -161,7 +159,6 @@ errorCode :: ErrorMessage -> String
161errorCode em = case unwrapErrorMessage em of
159errorCode em = case unwrapErrorMessage em of
162 (ErrorParsingExterns _) -> "ErrorParsingExterns"
160 (ErrorParsingExterns _) -> "ErrorParsingExterns"
163 (ErrorParsingFFIModule _) -> "ErrorParsingFFIModule"
161 (ErrorParsingFFIModule _) -> "ErrorParsingFFIModule"
164− (ErrorParsingPrelude _) -> "ErrorParsingPrelude"
165 (ErrorParsingModule _) -> "ErrorParsingModule"
162 (ErrorParsingModule _) -> "ErrorParsingModule"
166 MissingFFIModule{} -> "MissingFFIModule"
163 MissingFFIModule{} -> "MissingFFIModule"
167 MultipleFFIModules{} -> "MultipleFFIModules"
164 MultipleFFIModules{} -> "MultipleFFIModules"
@@ -229,7 +226,6 @@ errorCode em = case unwrapErrorMessage em of
229 (TransitiveExportError _ _) -> "TransitiveExportError"
226 (TransitiveExportError _ _) -> "TransitiveExportError"
230 (ShadowedName _) -> "ShadowedName"
227 (ShadowedName _) -> "ShadowedName"
231 (WildcardInferredType _) -> "WildcardInferredType"
228 (WildcardInferredType _) -> "WildcardInferredType"
232− PreludeNotPresent -> "PreludeNotPresent"
233
229
234-- |
230-- |
235-- A stack trace for an error
231-- A stack trace for an error
@@ -393,10 +389,6 @@ prettyPrintSingleError full e = prettyPrintErrorMessage <$> onTypesInErrorMessag
393 goSimple (MultipleFFIModules mn paths) =
389 goSimple (MultipleFFIModules mn paths) =
394 paras $ [ line $ "Multiple FFI implementations have been provided for module " ++ show mn ++ ": " ]
390 paras $ [ line $ "Multiple FFI implementations have been provided for module " ++ show mn ++ ": " ]
395 ++ map (indent . line) paths
391 ++ map (indent . line) paths
396− goSimple (ErrorParsingPrelude err) =
397− paras [ line "Error parsing prelude: "
398− , indent . line . show $ err
399− ]
400 goSimple (InvalidExternsFile path) =
392 goSimple (InvalidExternsFile path) =
401 paras [ line "Externs file is invalid: "
393 paras [ line "Externs file is invalid: "
402 , indent . line $ path
394 , indent . line $ path
@@ -553,10 +545,6 @@ prettyPrintSingleError full e = prettyPrintErrorMessage <$> onTypesInErrorMessag
553 line $ "Name '" ++ show nm ++ "' was shadowed."
545 line $ "Name '" ++ show nm ++ "' was shadowed."
554 goSimple (WildcardInferredType ty) =
546 goSimple (WildcardInferredType ty) =
555 line $ "The wildcard type definition has the inferred type " ++ prettyPrintType ty
547 line $ "The wildcard type definition has the inferred type " ++ prettyPrintType ty
556− goSimple PreludeNotPresent =
557− paras [ line $ "There is no Prelude module loaded, and the --no-prelude option was not specified."
558− , line $ "You probably need to install the Prelude and other dependencies using Bower."
559− ]
560 go (NotYetDefined names err) =
548 go (NotYetDefined names err) =
561 paras [ line $ "The following are not yet defined here: " ++ intercalate ", " (map show names) ++ ":"
549 paras [ line $ "The following are not yet defined here: " ++ intercalate ", " (map show names) ++ ":"
562 , indent $ go err
550 , indent $ go err
src/Language/PureScript/Options.hs+3−7
@@ -44,14 +44,10 @@ deriving instance Show (ModeOptions mode)
44-- The data type of compiler options
44-- The data type of compiler options
45--
45--
46data Options mode = Options {
46data Options mode = Options {
47− -- |
48− -- Disable inclusion of the built in Prelude
49− --
50− optionsNoPrelude :: Bool
51 -- |
47 -- |
52 -- Disable tail-call elimination
48 -- Disable tail-call elimination
53 --
49 --
54− , optionsNoTco :: Bool
50+ optionsNoTco :: Bool
55 -- |
51 -- |
56 -- Disable inlining of calls to return and bind for the Eff monad
52 -- Disable inlining of calls to return and bind for the Eff monad
57 --
53 --
@@ -83,10 +79,10 @@ data Options mode = Options {
83-- Default compiler options
79-- Default compiler options
84--
80--
85defaultCompileOptions :: Options Compile
81defaultCompileOptions :: Options Compile
86−defaultCompileOptions = Options False False False Nothing False False False (CompileOptions "PS" [] [])
82+defaultCompileOptions = Options False False Nothing False False False (CompileOptions "PS" [] [])
87
83
88-- |
84-- |
89-- Default make options
85-- Default make options
90--
86--
91defaultMakeOptions :: Options Make
87defaultMakeOptions :: Options Make
92−defaultMakeOptions = Options False False False Nothing False False False MakeOptions
88+defaultMakeOptions = Options False False Nothing False False False MakeOptions
tests/prelude/Prelude.purs+18−11
@@ -1,5 +1,5 @@
1-- | This snapshot is provided for the purposes of running the test suite.
1-- | This snapshot is provided for the purposes of running the test suite.
2−-- | It is not necessarily kept up to date with the official PureScript Prelude,
2+-- | It is not necessarily kept up to date with the official PureScript Prelude,
3-- | and should not be used in user code.
3-- | and should not be used in user code.
4-- | The official Prelude can be found at https://github.com/purescript/purescript-prelude
4-- | The official Prelude can be found at https://github.com/purescript/purescript-prelude
5
5
@@ -70,7 +70,7 @@ module Prelude
70
70
71 (:) :: forall a. a -> Array a -> Array a
71 (:) :: forall a. a -> Array a -> Array a
72 (:) = cons
72 (:) = cons
73−
73+
74 foreign import concat :: forall a. Array a -> Array a -> Array a
74 foreign import concat :: forall a. Array a -> Array a -> Array a
75
75
76 infixr 9 >>>
76 infixr 9 >>>
@@ -222,11 +222,11 @@ module Prelude
222 instance moduloSemiringUnit :: ModuloSemiring Unit where
222 instance moduloSemiringUnit :: ModuloSemiring Unit where
223 (/) _ _ = unit
223 (/) _ _ = unit
224 mod _ _ = unit
224 mod _ _ = unit
225−
225+
226 foreign import jsMod :: Number -> Number -> Number
226 foreign import jsMod :: Number -> Number -> Number
227
227
228 infixl 7 %
228 infixl 7 %
229−
229+
230 (%) = jsMod
230 (%) = jsMod
231
231
232 class (Ring a, ModuloSemiring a) <= DivisionRing a
232 class (Ring a, ModuloSemiring a) <= DivisionRing a
@@ -466,6 +466,8 @@ module Prelude
466
466
467module Data.Function where
467module Data.Function where
468
468
469+ import Prelude
470+
469 on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
471 on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
470 on f g x y = g x `f` g y
472 on f g x y = g x `f` g y
471
473
@@ -536,15 +538,16 @@ module Data.Function where
536 foreign import runFn10 :: forall a b c d e f g h i j k. Fn10 a b c d e f g h i j k -> a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k
538 foreign import runFn10 :: forall a b c d e f g h i j k. Fn10 a b c d e f g h i j k -> a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k
537
539
538module Assert where
540module Assert where
539−
541+
542+ import Prelude
540 import Control.Monad.Eff
543 import Control.Monad.Eff
541−
544+
542 foreign import data Assert :: !
545 foreign import data Assert :: !
543−
546+
544 foreign import error :: forall a. String -> a
547 foreign import error :: forall a. String -> a
545−
548+
546 foreign import assertPartial :: forall e a. (Unit -> a) -> Eff (assert :: Assert | e) Unit
549 foreign import assertPartial :: forall e a. (Unit -> a) -> Eff (assert :: Assert | e) Unit
547−
550+
548 assert :: forall e. Boolean -> Eff (assert :: Assert | e) Unit
551 assert :: forall e. Boolean -> Eff (assert :: Assert | e) Unit
549 assert true = return unit
552 assert true = return unit
550 assert false = error "Assertion failed!"
553 assert false = error "Assertion failed!"
@@ -560,6 +563,8 @@ module Control.Monad.Eff
560 , untilE, whileE
563 , untilE, whileE
561 ) where
564 ) where
562
565
566+ import Prelude
567+
563 foreign import data Eff :: # ! -> * -> *
568 foreign import data Eff :: # ! -> * -> *
564
569
565 foreign import returnE :: forall e a. a -> Eff e a
570 foreign import returnE :: forall e a. a -> Eff e a
@@ -583,13 +588,14 @@ module Control.Monad.Eff
583 (>>=) = bindE
588 (>>=) = bindE
584
589
585 instance monadEff :: Monad (Eff e)
590 instance monadEff :: Monad (Eff e)
586−
591+
587 foreign import untilE :: forall e. Eff e Boolean -> Eff e Unit
592 foreign import untilE :: forall e. Eff e Boolean -> Eff e Unit
588−
593+
589 foreign import whileE :: forall e a. Eff e Boolean -> Eff e a -> Eff e Unit
594 foreign import whileE :: forall e a. Eff e Boolean -> Eff e a -> Eff e Unit
590
595
591module Debug.Trace where
596module Debug.Trace where
592
597
598+ import Prelude
593 import Control.Monad.Eff
599 import Control.Monad.Eff
594
600
595 foreign import data Trace :: !
601 foreign import data Trace :: !
@@ -601,6 +607,7 @@ module Debug.Trace where
601
607
602module Control.Monad.ST where
608module Control.Monad.ST where
603
609
610+ import Prelude
604 import Control.Monad.Eff
611 import Control.Monad.Eff
605
612
606 foreign import data ST :: * -> !
613 foreign import data ST :: * -> !