git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Remove implicit Prelude import
commit9383c0e6387fa9c1baa92d6e16bef3175d255936 authorGary Burgess <gary.burgess@gmail.com> dateWed 3 Jun 2015, 20:16 (11 years ago) parent193e1fd
176 files changed+650−442
examples/failing/365.purs+2 examples/failing/438.purs+4−2 examples/failing/ArrayType.purs+1 examples/failing/Arrays.purs+2−2 examples/failing/Do.purs+2 examples/failing/DuplicateDeclarationsInLet.purs+2 examples/failing/DuplicateProperties1.purs+2 examples/failing/DuplicateProperties2.purs+2 examples/failing/DuplicateTypeVars.purs+2 examples/failing/Foldable.purs+2 examples/failing/InstanceExport.purs+2 examples/failing/KindError.purs+3−1 examples/failing/LeadingZeros1.purs+3−1 examples/failing/LeadingZeros2.purs+3−1 examples/failing/Let.purs+2 examples/failing/MPTCs.purs+2 examples/failing/MissingClassExport.purs+4−2 examples/failing/MissingClassMemberExport.purs+4−2 examples/failing/MultipleErrors.purs+2 examples/failing/MultipleErrors2.purs+2 examples/failing/MutRec.purs+2 examples/failing/MutRec2.purs+2 examples/failing/NewtypeMultiArgs.purs+2 examples/failing/NewtypeMultiCtor.purs+2 examples/failing/NoOverlap.purs+2 examples/failing/NullaryAbs.purs+3−1 examples/failing/Object.purs+2 examples/failing/OverlappingArguments.purs+2 examples/failing/OverlappingBinders.purs+2 examples/failing/OverlappingInstances.purs+2 examples/failing/OverlappingInstances2.purs+2 examples/failing/OverlappingVars.purs+2 examples/failing/Rank2Types.purs+3−3 examples/failing/Reserved.purs+2 examples/failing/RowConstructors1.purs+2 examples/failing/RowConstructors2.purs+2 examples/failing/RowConstructors3.purs+2 examples/failing/SkolemEscape.purs+4−2 examples/failing/Superclasses1.purs+2 examples/failing/Superclasses2.purs+2 examples/failing/Superclasses3.purs+2 examples/failing/Superclasses4.purs+2 examples/failing/TopLevelCaseNoArgs.purs+6−3 examples/failing/TypeClassInstances.purs+2 examples/failing/TypeError.purs+2−2 examples/failing/TypeSynonyms.purs+2 examples/failing/TypeSynonyms2.purs+2 examples/failing/TypeSynonyms3.purs+2 examples/failing/TypeSynonyms4.purs+2 examples/failing/TypeSynonyms5.purs+2 examples/failing/TypeWildcards1.purs+2 examples/failing/TypeWildcards2.purs+2 examples/failing/TypeWildcards3.purs+2 examples/failing/UnderscoreModuleName.purs+2 examples/failing/UnifyInTypeInstanceLookup.purs+2 examples/failing/UnknownType.purs+2 examples/manual/QualifiedNames.purs+2 examples/manual/failing/ArgLengthMismatch.purs+4−2 examples/manual/failing/ExportExplicit.purs+4−2 examples/manual/failing/ExportExplicit2.purs+4−2 examples/manual/failing/OrphanTypeDecl.purs+1−1 examples/manual/failing/RedefinedFixity.purs+5−3 examples/manual/failing/RequiredHiddenType.purs+4−4 examples/manual/passing/ExportedInstanceDeclarations.purs+2 examples/manual/passing/TransitiveImport.purs+3 examples/passing/652.purs+2 examples/passing/810.purs+2 examples/passing/ArrayType.purs+2 examples/passing/Auto.purs+9−7 examples/passing/AutoPrelude.purs+1 examples/passing/AutoPrelude2.purs+1 examples/passing/BindersInFunctions.purs−1 examples/passing/BindingGroups.purs+2 examples/passing/BlockString.purs+2 examples/passing/CaseInDo.purs+1 examples/passing/CaseStatement.purs+2 examples/passing/CheckFunction.purs+2 examples/passing/CheckSynonymBug.purs+4−4 examples/passing/CheckTypeClass.purs+11−9 examples/passing/Church.purs+10−10 examples/passing/Collatz.purs+1 examples/passing/Comparisons.purs+1 examples/passing/Conditional.purs+4−4 examples/passing/DataAndType.purs+2 examples/passing/DeepArrayBinder.purs+1 examples/passing/DeepCase.purs+1 examples/passing/EmptyRow.purs+2 examples/passing/EqOrd.purs+2 examples/passing/ExtendedInfixOperators.purs+2 examples/passing/FunctionScope.purs+9−9 examples/passing/Functions.purs+7−7 examples/passing/Functions2.purs+9−9 examples/passing/Guards.purs+2 examples/passing/HoistError.purs+1 examples/passing/IfThenElseMaybe.purs+2 examples/passing/ImplicitEmptyImport.purs+2 examples/passing/InstanceBeforeClass.purs+2 examples/passing/IntAndChar.purs+2−1 examples/passing/JSReserved.purs+6−6 examples/passing/KindedType.purs+2 examples/passing/Let2.purs+3−1 examples/passing/LetInInstance.purs+2 examples/passing/LiberalTypeSynonyms.purs+2 examples/passing/Match.purs+5−3 examples/passing/Monad.purs+21−21 examples/passing/MultiArgFunctions.purs+1 examples/passing/MutRec.purs+10−10 examples/passing/MutRec2.purs+2 examples/passing/MutRec3.purs+2 examples/passing/NamedPatterns.purs+6−4 examples/passing/NegativeBinder.purs+2 examples/passing/Nested.purs+5−3 examples/passing/NestedTypeSynonyms.purs+6−6 examples/passing/NestedWhere.purs+2 examples/passing/Newtype.purs+1 examples/passing/NewtypeEff.purs+1 examples/passing/NewtypeWithRecordUpdate.purs+2−1 examples/passing/ObjectGetter.purs+2 examples/passing/ObjectSynonym.purs+2 examples/passing/ObjectUpdate.purs+13−11 examples/passing/ObjectUpdate2.purs+2 examples/passing/ObjectUpdater.purs+1 examples/passing/ObjectWildcards.purs+1 examples/passing/Objects.purs+20−20 examples/passing/OneConstructor.purs+2 examples/passing/OperatorAssociativity.purs+3−2 examples/passing/OperatorInlining.purs+1 examples/passing/OperatorSections.purs+1 examples/passing/Operators.purs+68−67 examples/passing/PartialFunction.purs+1 examples/passing/Patterns.purs+15−15 examples/passing/Person.purs+7−5 examples/passing/Rank2Data.purs+18−18 examples/passing/Rank2Object.purs+1 examples/passing/Rank2TypeSynonym.purs+1 examples/passing/Rank2Types.purs+6−6 examples/passing/RebindableSyntax.purs+2 examples/passing/Recursion.purs+6−6 examples/passing/ReservedWords.purs+9−7 examples/passing/RowConstructors.purs+2 examples/passing/RowPolyInstanceContext.purs+2 examples/passing/ScopedTypeVariables.purs+3−1 examples/passing/Sequence.purs+1 examples/passing/SequenceDesugared.purs+1 examples/passing/ShadowedRename.purs+1 examples/passing/ShadowedTCO.purs+2 examples/passing/ShadowedTCOLet.purs+2 examples/passing/SignedNumericLiterals.purs+12−10 examples/passing/Superclasses1.purs+2 examples/passing/Superclasses2.purs+1 examples/passing/Superclasses3.purs+1−1 examples/passing/TCOCase.purs+2 examples/passing/Tick.purs+2 examples/passing/TopLevelCase.purs+2 examples/passing/TypeClassMemberOrderChange.purs+2 examples/passing/TypeClassesWithOverlappingTypeVariables.purs+6−6 examples/passing/TypeDecl.purs+7−7 examples/passing/TypeSynonymInData.purs+2 examples/passing/TypeSynonyms.purs+20−18 examples/passing/TypeWildcards.purs+2 examples/passing/TypeWildcardsRecordExtension.purs+2 examples/passing/TypedWhere.purs+2 examples/passing/UnderscoreIdent.purs+2 examples/passing/UnknownInTypeClassLookup.purs+2 examples/passing/iota.purs+4−4 examples/passing/s.purs+4−2 psc-make/Main.hs+3−10 psc/Main.hs+3−10 psci/Make.hs+2−2 psci/PSCi.hs+3−9 psci/tests/Main.hs+1−1 src/Language/PureScript.hs+2−18 src/Language/PureScript/Docs/ParseAndDesugar.hs+1−4 src/Language/PureScript/Errors.hs−12 src/Language/PureScript/Options.hs+3−7 tests/prelude/Prelude.purs+18−11
examples/failing/365.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35class C a where
46 f :: a -> a
57 g :: a -> a
examples/failing/438.purs+4−2
@@ -1,9 +1,11 @@
11module Main where
2−
2+
3+import Prelude
4+
35data Fix f = In (f (Fix f))
46
57instance eqFix :: (Eq (f (Fix f))) => Eq (Fix f) where
68 (==) (In f) (In g) = f == g
79 (/=) a b = not (a == b)
8−
10+
911example = In [] == In []
examples/failing/ArrayType.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Debug.Trace
45
56bar :: Number -> Number -> Number
examples/failing/Arrays.purs+2−2
@@ -1,5 +1,5 @@
11module Main where
22
3− import Prelude
3+import Prelude
44
5− test = \arr -> arr !! (0 !! 0)
5+test = \arr -> arr !! (0 !! 0)
examples/failing/Do.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35test1 = do let x = 1
46
57test2 y = do x <- y
examples/failing/DuplicateDeclarationsInLet.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35foo = a
46 where
57 a :: Number
examples/failing/DuplicateProperties1.purs+2
@@ -1,5 +1,7 @@
11module DuplicateProperties where
22
3+import Prelude
4+
35foreign import data Test :: # * -> *
46
57foreign import subtractX :: forall r. Test (x :: Unit | r) -> Test r
examples/failing/DuplicateProperties2.purs+2
@@ -1,5 +1,7 @@
11module DuplicateProperties where
22
3+import Prelude
4+
35foreign import data Test :: # * -> *
46
57foreign import subtractX :: forall r. Test (x :: Unit | r) -> Test r
examples/failing/DuplicateTypeVars.purs+2
@@ -1,3 +1,5 @@
11module Main where
22
3+import Prelude
4+
35type Foo a a = a
examples/failing/Foldable.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35class Foldable f where
46 fold :: forall a b. (a -> b -> b) -> b -> f a -> b
57 size :: forall a. f a -> Number
examples/failing/InstanceExport.purs+2
@@ -1,5 +1,7 @@
11module InstanceExport (S(..), f) where
22
3+import Prelude
4+
35newtype S = S String
46
57class F a where
examples/failing/KindError.purs+3−1
@@ -1,3 +1,5 @@
11module Main where
22
3− data KindError f a = One f | Two (f a)
3+import Prelude
4+
5+data KindError f a = One f | Two (f a)
examples/failing/LeadingZeros1.purs+3−1
@@ -1,3 +1,5 @@
11module Main where
22
3−x = 01
3+import Prelude
4+
5+x = 01
examples/failing/LeadingZeros2.purs+3−1
@@ -1,3 +1,5 @@
11module Main where
22
3−x = 00.1
3+import Prelude
4+
5+x = 00.1
examples/failing/Let.purs+2
@@ -1,3 +1,5 @@
11module Main where
22
3+import Prelude
4+
35test = let x = x in x
examples/failing/MPTCs.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35class Foo a where
46 f :: a -> a
57
examples/failing/MissingClassExport.purs+4−2
@@ -1,4 +1,6 @@
11module Test (bar) where
22
3− class Foo a where
4− bar :: a -> a
3+import Prelude
4+
5+class Foo a where
6+ bar :: a -> a
examples/failing/MissingClassMemberExport.purs+4−2
@@ -1,4 +1,6 @@
11module Test (Foo) where
22
3− class Foo a where
4− bar :: a -> a
3+import Prelude
4+
5+class Foo a where
6+ bar :: a -> a
examples/failing/MultipleErrors.purs+2
@@ -1,5 +1,7 @@
11module MultipleErrors where
22
3+import Prelude
4+
35foo :: Number -> Number
46foo 0 = "Test"
57foo n = bar (n - 1)
examples/failing/MultipleErrors2.purs+2
@@ -1,5 +1,7 @@
11module MultipleErrors2 where
22
3+import Prelude
4+
35foo = itDoesntExist
46
57bar = neitherDoesThis
examples/failing/MutRec.purs+2
@@ -1,5 +1,7 @@
11module MutRec where
22
3+import Prelude
4+
35x = y
46
57y = x
examples/failing/MutRec2.purs+2
@@ -1,3 +1,5 @@
11module Main where
22
3+import Prelude
4+
35x = x
examples/failing/NewtypeMultiArgs.purs+2
@@ -1,3 +1,5 @@
11module Main where
22
3+import Prelude
4+
35newtype Thing = Thing String Boolean
examples/failing/NewtypeMultiCtor.purs+2
@@ -1,3 +1,5 @@
11module Main where
22
3+import Prelude
4+
35newtype Thing = Thing String | Other
examples/failing/NoOverlap.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35data Foo = Foo
46
57instance showFoo1 :: Show Foo where
examples/failing/NullaryAbs.purs+3−1
@@ -1,3 +1,5 @@
11module Main where
22
3− func = \ -> "no"
3+import Prelude
4+
5+func = \ -> "no"
examples/failing/Object.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35test o = o.foo
46
57test1 = test {}
examples/failing/OverlappingArguments.purs+2
@@ -1,3 +1,5 @@
11module OverlappingArguments where
22
3+import Prelude
4+
35f x x = x
examples/failing/OverlappingBinders.purs+2
@@ -1,5 +1,7 @@
11module OverlappingBinders where
22
3+import Prelude
4+
35data S a = S a (S a)
46
57f x = case x of
examples/failing/OverlappingInstances.purs+2
@@ -1,5 +1,7 @@
11module OverlappingInstances where
22
3+import Prelude
4+
35data A = A
46
57instance showA1 :: Show A where
examples/failing/OverlappingInstances2.purs+2
@@ -1,5 +1,7 @@
11module OverlappingInstances where
22
3+import Prelude
4+
35data A = A | B
46
57instance eqA1 :: Eq A where
examples/failing/OverlappingVars.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35class OverlappingVars a where
46 f :: a -> a
57
examples/failing/Rank2Types.purs+3−3
@@ -1,7 +1,7 @@
11module Main where
22
3− import Prelude
3+import Prelude
44
5− foreign import test :: (forall a. a -> a) -> Number
5+foreign import test :: (forall a. a -> a) -> Number
66
7− test1 = test (\n -> n + 1)
7+test1 = test (\n -> n + 1)
examples/failing/Reserved.purs+2
@@ -1,4 +1,6 @@
11module Main where
22
3+import Prelude
4+
35(<) :: Number -> Number -> Number
46(<) a b = !(a >= b)
examples/failing/RowConstructors1.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35data Foo = Bar
46type Baz = { | Foo }
57
examples/failing/RowConstructors2.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35type Foo r = (x :: Number | r)
46type Bar = { | Foo }
57
examples/failing/RowConstructors3.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35type Foo = { x :: Number }
46type Bar = { | Foo }
57
examples/failing/SkolemEscape.purs+4−2
@@ -1,5 +1,7 @@
11module Main where
22
3− foreign import foo :: (forall a. a -> a) -> Number
3+import Prelude
44
5− test = \x -> foo x
5+foreign import foo :: (forall a. a -> a) -> Number
6+
7+test = \x -> foo x
examples/failing/Superclasses1.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35class Su a where
46 su :: a -> a
57
examples/failing/Superclasses2.purs+2
@@ -1,5 +1,7 @@
11module CycleInSuperclasses where
22
3+import Prelude
4+
35class (Foo a) <= Bar a
46
57class (Bar a) <= Foo a
examples/failing/Superclasses3.purs+2
@@ -1,5 +1,7 @@
11module UnknownSuperclassTypeVar where
22
3+import Prelude
4+
35class Foo a
46
57class (Foo b) <= Bar a
examples/failing/Superclasses4.purs+2
@@ -1,5 +1,7 @@
11module OverlappingInstances where
22
3+import Prelude
4+
35class Foo a
46
57instance foo1 :: Foo Number
examples/failing/TopLevelCaseNoArgs.purs+6−3
@@ -1,4 +1,7 @@
11module Main where
2− foo :: Number
3− foo = 1
4− foo = 2
2+
3+import Prelude
4+
5+foo :: Number
6+foo = 1
7+foo = 2
examples/failing/TypeClassInstances.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35class A a where
46 a :: a -> String
57 b :: a -> Number
examples/failing/TypeError.purs+2−2
@@ -1,5 +1,5 @@
11module Main where
22
3− import Prelude
3+import Prelude
44
5− test = 1 ++ "A"
5+test = 1 ++ "A"
examples/failing/TypeSynonyms.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35type T1 = Array T2
46
57type T2 = T1
examples/failing/TypeSynonyms2.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35class Foo a where
46 foo :: a -> String
57
examples/failing/TypeSynonyms3.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35class Foo a where
46 foo :: a -> String
57
examples/failing/TypeSynonyms4.purs+2
@@ -1,5 +1,7 @@
11module TypeSynonyms4 where
22
3+import Prelude
4+
35type F x y = x -> y
46
57type G x = F x
examples/failing/TypeSynonyms5.purs+2
@@ -1,3 +1,5 @@
11module Main where
22
3+import Prelude
4+
35type T = T
examples/failing/TypeWildcards1.purs+2
@@ -1,4 +1,6 @@
11module TypeWildcards where
22
3+import Prelude
4+
35type Test = _
46
examples/failing/TypeWildcards2.purs+2
@@ -1,4 +1,6 @@
11module TypeWildcards where
22
3+import Prelude
4+
35data Test = Test _
46
examples/failing/TypeWildcards3.purs+2
@@ -1,5 +1,7 @@
11module TypeWildcards where
22
3+import Prelude
4+
35data Foo a = Foo
46
57instance showFoo :: Show (Foo _) where
examples/failing/UnderscoreModuleName.purs+2
@@ -1,3 +1,5 @@
11module Bad_Module where
22
3+import Prelude
4+
35main = Debug.Trace.trace "Done"
examples/failing/UnifyInTypeInstanceLookup.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35data Z = Z
46data S n = S n
57
examples/failing/UnknownType.purs+2
@@ -1,4 +1,6 @@
11module Main where
22
3+import Prelude
4+
35test :: Number -> Something
46test = {}
examples/manual/QualifiedNames.purs+2
@@ -1,5 +1,7 @@
11module Data.Either where
22
3+import Prelude
4+
35data Either a b = Left a | Right b
46
57module Main where
examples/manual/failing/ArgLengthMismatch.purs+4−2
@@ -1,4 +1,6 @@
11module ArgLengthMismatch where
22
3− f x y = true
4− f = false
3+import Prelude
4+
5+f x y = true
6+f = false
examples/manual/failing/ExportExplicit.purs+4−2
@@ -1,5 +1,7 @@
11-- should fail as z does not exist in the module
22module M1 (x, y, z) where
33
4− x = 1
5− y = 2
4+import Prelude
5+
6+x = 1
7+y = 2
examples/manual/failing/ExportExplicit2.purs+4−2
@@ -1,5 +1,7 @@
11-- should fail as Y is not a data constructor for X
22module M1 (X(Y)) where
33
4− data X = X
5− data Y = Y
4+import Prelude
5+
6+data X = X
7+data Y = Y
examples/manual/failing/OrphanTypeDecl.purs+1−1
@@ -1,3 +1,3 @@
11module OrphanTypeDecl where
22
3− fn :: Number -> Boolean
3+fn :: Number -> Boolean
examples/manual/failing/RedefinedFixity.purs+5−3
@@ -1,6 +1,8 @@
11module RedefinedFixity where
22
3− (!?) x y = x + y
3+import Prelude
44
5− infix 2 !?
6− infix 2 !?
5+(!?) x y = x + y
6+
7+infix 2 !?
8+infix 2 !?
examples/manual/failing/RequiredHiddenType.purs+4−4
@@ -1,8 +1,8 @@
11-- exporting `a` should fail as `A` is hidden
22module Foo (B(..), a, b) where
33
4− data A = A
5− data B = B
4+data A = A
5+data B = B
66
7− a = A
8− b = B
7+a = A
8+b = B
examples/manual/passing/ExportedInstanceDeclarations.purs+2
@@ -8,6 +8,8 @@ module ExportedInstanceDeclarations
88 , foo
99 ) where
1010
11+import Prelude
12+
1113data Const a b = Const a
1214
1315class Foo a where
examples/manual/passing/TransitiveImport.purs+3
@@ -1,5 +1,7 @@
11module Test where
22
3+ import Prelude
4+
35 class TestCls a where
46 test :: a -> a
57
@@ -12,6 +14,7 @@ module Middle where
1214
1315module Main where
1416
17+ import Prelude
1518 import Middle
1619 import Debug.Trace
1720
examples/passing/652.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35class Foo a b
46
57class Bar a c
examples/passing/810.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35data Maybe a = Nothing | Just a
46
57test :: forall a. Maybe a -> Maybe a
examples/passing/ArrayType.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35class Pointed p where
46 point :: forall a. a -> p a
57
examples/passing/Auto.purs+9−7
@@ -1,13 +1,15 @@
11module Main where
22
3− data Auto s i o = Auto { state :: s, step :: s -> i -> o }
3+import Prelude
44
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 }
66
7− exists :: forall s i o. s -> (s -> i -> o) -> SomeAuto i o
8− exists = \state step f -> f (Auto { state: state, step: step })
7+type SomeAuto i o = forall r. (forall s. Auto s i o -> r) -> r
98
10− run :: forall i o. SomeAuto i o -> i -> o
11− run = \s i -> s (\a -> case a of Auto a -> a.step a.state i)
9+exists :: forall s i o. s -> (s -> i -> o) -> SomeAuto i o
10+exists = \state step f -> f (Auto { state: state, step: step })
1211
13− main = Debug.Trace.trace "Done"
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+
15+main = Debug.Trace.trace "Done"
examples/passing/AutoPrelude.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Debug.Trace
45
56f x = x * 10.0
examples/passing/AutoPrelude2.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import qualified Prelude as P
45import Debug.Trace
56
examples/passing/BindersInFunctions.purs−1
@@ -1,7 +1,6 @@
11module Main where
22
33import Prelude
4−
54import Assert
65
76snd = \[_, y] -> y
examples/passing/BindingGroups.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35foo = bar
46 where bar r = r + 1.0
57
examples/passing/BlockString.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35foo :: String
46foo = """foo"""
57
examples/passing/CaseInDo.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Debug.Trace
45import Control.Monad.Eff
56
examples/passing/CaseStatement.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35data A = A | B | C
46
57f a _ A = a
examples/passing/CheckFunction.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35test = ((\x -> x+1.0) >>> (\x -> x*2.0)) 4.0
46
57main = Debug.Trace.trace "Done"
examples/passing/CheckSynonymBug.purs+4−4
@@ -1,9 +1,9 @@
11module Main where
22
3− import Prelude
3+import Prelude
44
5− type Foo a = Array a
5+type Foo a = Array a
66
7− foo _ = length ([] :: Foo Number)
7+foo _ = length ([] :: Foo Number)
88
9− main = Debug.Trace.trace "Done"
9+main = Debug.Trace.trace "Done"
examples/passing/CheckTypeClass.purs+11−9
@@ -1,16 +1,18 @@
11module Main where
22
3− data Bar a = Bar
4− data Baz
3+import Prelude
54
6− class Foo a where
7− foo :: Bar a -> Baz
5+data Bar a = Bar
6+data Baz
87
9− foo_ :: forall a. (Foo a) => a -> Baz
10− foo_ x = foo ((mkBar :: forall a. (Foo a) => a -> Bar a) x)
8+class Foo a where
9+ foo :: Bar a -> Baz
1110
12− mkBar :: forall a. a -> Bar a
13− mkBar _ = Bar
11+foo_ :: forall a. (Foo a) => a -> Baz
12+foo_ x = foo ((mkBar :: forall a. (Foo a) => a -> Bar a) x)
1413
15− main = Debug.Trace.trace "Done"
14+mkBar :: forall a. a -> Bar a
15+mkBar _ = Bar
16+
17+main = Debug.Trace.trace "Done"
1618
examples/passing/Church.purs+10−10
@@ -1,18 +1,18 @@
11module Main where
22
3− import Prelude ()
3+import Prelude ()
44
5− type List a = forall r. r -> (a -> r -> r) -> r
5+type List a = forall r. r -> (a -> r -> r) -> r
66
7− empty :: forall a. List a
8− empty = \r f -> r
7+empty :: forall a. List a
8+empty = \r f -> r
99
10− cons :: forall a. a -> List a -> List a
11− cons = \a l r f -> f a (l r f)
10+cons :: forall a. a -> List a -> List a
11+cons = \a l r f -> f a (l r f)
1212
13− append :: forall a. List a -> List a -> List a
14− append = \l1 l2 r f -> l2 (l1 r f) f
13+append :: forall a. List a -> List a -> List a
14+append = \l1 l2 r f -> l2 (l1 r f) f
1515
16− test = append (cons 1 empty) (cons 2 empty)
16+test = append (cons 1 empty) (cons 2 empty)
1717
18− main = Debug.Trace.trace "Done"
18+main = Debug.Trace.trace "Done"
examples/passing/Collatz.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Control.Monad.Eff
45import Control.Monad.ST
56
examples/passing/Comparisons.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Control.Monad.Eff
45import Debug.Trace
56import Assert
examples/passing/Conditional.purs+4−4
@@ -1,9 +1,9 @@
11module Main where
22
3− import Prelude ()
3+import Prelude ()
44
5− fns = \f -> if f true then f else \x -> x
5+fns = \f -> if f true then f else \x -> x
66
7− not = \x -> if x then false else true
7+not = \x -> if x then false else true
88
9− main = Debug.Trace.trace "Done"
9+main = Debug.Trace.trace "Done"
examples/passing/DataAndType.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35data A = A B
46
57type B = A
examples/passing/DeepArrayBinder.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Control.Monad.Eff
45import Assert
56
examples/passing/DeepCase.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Debug.Trace
45import Control.Monad.Eff
56import Control.Monad.ST
examples/passing/EmptyRow.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35data Foo r = Foo { | r }
46
57test :: Foo ()
examples/passing/EqOrd.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35data Pair a b = Pair a b
46
57instance ordPair :: (Ord a, Ord b) => Ord (Pair a b) where
examples/passing/ExtendedInfixOperators.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35comparing :: forall a b. (Ord b) => (a -> b) -> a -> a -> Ordering
46comparing f = compare `Data.Function.on` f
57
examples/passing/FunctionScope.purs+9−9
@@ -1,13 +1,13 @@
11module Main where
22
3− import Prelude
4− import Assert
3+import Prelude
4+import Assert
55
6− mkValue :: Number -> Number
7− mkValue id = id
6+mkValue :: Number -> Number
7+mkValue id = id
88
9− main = do
10− let value = mkValue 1.0
11− if value == 1.0
12− then Debug.Trace.trace "Done"
13− else error "Not done"
9+main = do
10+ let value = mkValue 1.0
11+ if value == 1.0
12+ then Debug.Trace.trace "Done"
13+ else error "Not done"
examples/passing/Functions.purs+7−7
@@ -1,15 +1,15 @@
11module Main where
22
3− import Prelude
3+import Prelude
44
5− test1 = \_ -> 0.0
5+test1 = \_ -> 0.0
66
7− test2 = \a b -> a + b + 1.0
7+test2 = \a b -> a + b + 1.0
88
9− test3 = \a -> a
9+test3 = \a -> a
1010
11− test4 = \(%%) -> 1.0 %% 2.0
11+test4 = \(%%) -> 1.0 %% 2.0
1212
13− test5 = \(+++) (***) -> 1.0 +++ 2.0 *** 3.0
13+test5 = \(+++) (***) -> 1.0 +++ 2.0 *** 3.0
1414
15− main = Debug.Trace.trace "Done"
15+main = Debug.Trace.trace "Done"
examples/passing/Functions2.purs+9−9
@@ -1,13 +1,13 @@
11module Main where
22
3− import Prelude
4− import Assert
3+import Prelude
4+import Assert
55
6− test :: forall a b. a -> b -> a
7− test = \const _ -> const
6+test :: forall a b. a -> b -> a
7+test = \const _ -> const
88
9− main = do
10− let value = test "Done" {}
11− if value == "Done"
12− then Debug.Trace.trace "Done"
13− else error "Not done"
9+main = do
10+ let value = test "Done" {}
11+ if value == "Done"
12+ then Debug.Trace.trace "Done"
13+ else error "Not done"
examples/passing/Guards.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35collatz = \x -> case x of
46 y | y % 2.0 == 0.0 -> y / 2.0
57 y -> y * 3.0 + 1.0
examples/passing/HoistError.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Control.Monad.Eff
45import Debug.Trace
56import Assert
examples/passing/IfThenElseMaybe.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35data Maybe a = Nothing | Just a
46
57test1 = if true then Just 10 else Nothing
examples/passing/ImplicitEmptyImport.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35main = do
46 Debug.Trace.trace "Hello"
57 Debug.Trace.trace "Goodbye"
examples/passing/InstanceBeforeClass.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35instance fooNumber :: Foo Number where
46 foo = 0.0
57
examples/passing/IntAndChar.purs+2−1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Control.Monad.Eff
45import Assert
56
@@ -10,7 +11,7 @@ g 'a' = 'a'
1011g _ = 'b'
1112
1213main = do
13− assert $ f 1 == 1
14+ assert $ f 1 == 1
1415 assert $ f 0 == 0
1516 assert $ g 'a' == 'a'
1617 assert $ g 'b' == 'b'
examples/passing/JSReserved.purs+6−6
@@ -1,12 +1,12 @@
11module Main where
22
3− import Prelude
3+import Prelude
44
5− yield = 0
6− member = 1
5+yield = 0
6+member = 1
77
8− public = \return -> return
8+public = \return -> return
99
10− this catch = catch
10+this catch = catch
1111
12− main = Debug.Trace.trace "Done"
12+main = Debug.Trace.trace "Done"
examples/passing/KindedType.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35type Star2Star f = f :: * -> *
46
57type Star t = t :: *
examples/passing/Let2.purs+3−1
@@ -1,6 +1,8 @@
11module Main where
22
3−test =
3+import Prelude
4+
5+test =
46 let f :: Number -> Boolean
57 f 0.0 = false
68 f n = g (n - 1.0)
examples/passing/LetInInstance.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35class Foo a where
46 foo :: a -> String
57
examples/passing/LiberalTypeSynonyms.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35type Reader = (->) String
46
57foo :: Reader String
examples/passing/Match.purs+5−3
@@ -1,7 +1,9 @@
11module Main where
22
3− data Foo a = Foo
3+import Prelude
44
5− foo = \f -> case f of Foo -> "foo"
5+data Foo a = Foo
66
7− main = Debug.Trace.trace "Done"
7+foo = \f -> case f of Foo -> "foo"
8+
9+main = Debug.Trace.trace "Done"
examples/passing/Monad.purs+21−21
@@ -1,32 +1,32 @@
11module Main where
22
3− import Prelude ()
3+import Prelude ()
44
5− type Monad m = { return :: forall a. a -> m a
6− , bind :: forall a b. m a -> (a -> m b) -> m b }
5+type Monad m = { return :: forall a. a -> m a
6+ , bind :: forall a b. m a -> (a -> m b) -> m b }
77
8− data Id a = Id a
8+data Id a = Id a
99
10− id :: Monad Id
11− id = { return : Id
12− , bind : \ma f -> case ma of Id a -> f a }
10+id :: Monad Id
11+id = { return : Id
12+ , bind : \ma f -> case ma of Id a -> f a }
1313
14− data Maybe a = Nothing | Just a
14+data Maybe a = Nothing | Just a
1515
16− maybe :: Monad Maybe
17− maybe = { return : Just
18− , bind : \ma f -> case ma of
19− Nothing -> Nothing
20− Just a -> f a
21− }
16+maybe :: Monad Maybe
17+maybe = { return : Just
18+ , bind : \ma f -> case ma of
19+ Nothing -> Nothing
20+ Just a -> f a
21+ }
2222
23− test :: forall m. Monad m -> m Number
24− test = \m -> m.bind (m.return 1.0) (\n1 ->
25− m.bind (m.return "Test") (\n2 ->
26− m.return n1))
23+test :: forall m. Monad m -> m Number
24+test = \m -> m.bind (m.return 1.0) (\n1 ->
25+ m.bind (m.return "Test") (\n2 ->
26+ m.return n1))
2727
28− test1 = test id
28+test1 = test id
2929
30− test2 = test maybe
30+test2 = test maybe
3131
32− main = Debug.Trace.trace "Done"
32+main = Debug.Trace.trace "Done"
examples/passing/MultiArgFunctions.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Data.Function
45import Control.Monad.Eff
56import Debug.Trace
examples/passing/MutRec.purs+10−10
@@ -1,19 +1,19 @@
11module Main where
22
3− import Prelude
3+import Prelude
44
5− f 0.0 = 0.0
6− f x = g x + 0.0
5+f 0.0 = 0.0
6+f x = g x + 0.0
77
8− g x = f (x / 0.0)
8+g x = f (x / 0.0)
99
10− data Even = Zero | Even Odd
10+data Even = Zero | Even Odd
1111
12− data Odd = Odd Even
12+data Odd = Odd Even
1313
14− evenToNumber Zero = 0.0
15− evenToNumber (Even n) = oddToNumber n + 0.0
14+evenToNumber Zero = 0.0
15+evenToNumber (Even n) = oddToNumber n + 0.0
1616
17− oddToNumber (Odd n) = evenToNumber n + 0.0
17+oddToNumber (Odd n) = evenToNumber n + 0.0
1818
19− main = Debug.Trace.trace "Done"
19+main = Debug.Trace.trace "Done"
examples/passing/MutRec2.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35data A = A B
46
57data B = B A
examples/passing/MutRec3.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35data A = A B
46
57data B = B A
examples/passing/NamedPatterns.purs+6−4
@@ -1,7 +1,9 @@
11module Main where
22
3− foo = \x -> case x of
4− y@{ foo = "Foo" } -> y
5− y -> y
3+import Prelude
64
7− main = Debug.Trace.trace "Done"
5+foo = \x -> case x of
6+ y@{ foo = "Foo" } -> y
7+ y -> y
8+
9+main = Debug.Trace.trace "Done"
examples/passing/NegativeBinder.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35test :: Number -> Boolean
46test -1.0 = false
57test _ = true
examples/passing/Nested.purs+5−3
@@ -1,7 +1,9 @@
11module Main where
22
3− data Extend r a = Extend { prev :: r a, next :: a }
3+import Prelude
44
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 }
66
7− main = Debug.Trace.trace "Done"
7+data Matrix r a = Square (r (r a)) | Bigger (Matrix (Extend r) a)
8+
9+main = Debug.Trace.trace "Done"
examples/passing/NestedTypeSynonyms.purs+6−6
@@ -1,11 +1,11 @@
11module Main where
22
3− import Prelude
3+import Prelude
44
5− type X = String
6− type Y = X -> X
5+type X = String
6+type Y = X -> X
77
8− fn :: Y
9− fn a = a
8+fn :: Y
9+fn a = a
1010
11− main = Debug.Trace.print (fn "Done")
11+main = Debug.Trace.print (fn "Done")
examples/passing/NestedWhere.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35f x = g x
46 where
57 g x = go x
examples/passing/Newtype.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Control.Monad.Eff
45import Debug.Trace
56
examples/passing/NewtypeEff.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Debug.Trace
45import Control.Monad.Eff
56
examples/passing/NewtypeWithRecordUpdate.purs+2−1
@@ -2,12 +2,13 @@
22
33module Main where
44
5+import Prelude
56import Debug.Trace
67
78newtype NewType a = NewType (Object a)
89
910rec1 :: 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 }
1112
1213rec2 :: NewType (a :: Number, b :: Number, c :: Number)
1314rec2 = NewType (rec1 { a = 1.0 })
examples/passing/ObjectGetter.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35getX = _.x
46
57point = { x: 1.0, y: 0.0 }
examples/passing/ObjectSynonym.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35type Inner = Number
46
57inner :: Inner
examples/passing/ObjectUpdate.purs+13−11
@@ -1,18 +1,20 @@
11module Main where
22
3− update1 = \o -> o { foo = "Foo" }
3+import Prelude
44
5− update2 :: forall r. { foo :: String | r } -> { foo :: String | r }
6− update2 = \o -> o { foo = "Foo" }
5+update1 = \o -> o { foo = "Foo" }
76
8− replace = \o -> case o of
9− { foo = "Foo" } -> o { foo = "Bar" }
10− { foo = "Bar" } -> o { bar = "Baz" }
11− o -> o
7+update2 :: forall r. { foo :: String | r } -> { foo :: String | r }
8+update2 = \o -> o { foo = "Foo" }
129
13− polyUpdate :: forall a r. { foo :: a | r } -> { foo :: String | r }
14− polyUpdate = \o -> o { foo = "Foo" }
10+replace = \o -> case o of
11+ { foo = "Foo" } -> o { foo = "Bar" }
12+ { foo = "Bar" } -> o { bar = "Baz" }
13+ o -> o
1514
16− inferPolyUpdate = \o -> o { foo = "Foo" }
15+polyUpdate :: forall a r. { foo :: a | r } -> { foo :: String | r }
16+polyUpdate = \o -> o { foo = "Foo" }
1717
18− main = Debug.Trace.trace ((update1 {foo: ""}).foo)
18+inferPolyUpdate = \o -> o { foo = "Foo" }
19+
20+main = Debug.Trace.trace ((update1 {foo: ""}).foo)
examples/passing/ObjectUpdate2.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35type X r = { | r }
46
57x :: X (baz :: String)
examples/passing/ObjectUpdater.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Control.Monad.Eff
45import Debug.Trace
56import Assert
examples/passing/ObjectWildcards.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Control.Monad.Eff
45import Debug.Trace
56import Assert
examples/passing/Objects.purs+20−20
@@ -1,35 +1,35 @@
11module Main where
22
3− import Prelude
3+import Prelude
44
5− test = \x -> x.foo + x.bar + 1.0
5+test = \x -> x.foo + x.bar + 1.0
66
7− append = \o -> { foo: o.foo, bar: 1.0 }
7+append = \o -> { foo: o.foo, bar: 1.0 }
88
9− apTest = append({foo : "Foo", baz: "Baz"})
9+apTest = append({foo : "Foo", baz: "Baz"})
1010
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" }
1212
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 }
1414
15− typed :: { foo :: Number }
16− typed = { foo: 0.0 }
15+typed :: { foo :: Number }
16+typed = { foo: 0.0 }
1717
18− test2 = \x -> x."!@#"
18+test2 = \x -> x."!@#"
1919
20− test3 = typed."foo"
20+test3 = typed."foo"
2121
22− test4 = test2 weirdObj
23− where
24− weirdObj :: { "!@#" :: Number }
25− weirdObj = { "!@#": 1.0 }
22+test4 = test2 weirdObj
23+ where
24+ weirdObj :: { "!@#" :: Number }
25+ weirdObj = { "!@#": 1.0 }
2626
27− test5 = case { "***": 1.0 } of
28− { "***" = n } -> n
27+test5 = case { "***": 1.0 } of
28+ { "***" = n } -> n
2929
30− test6 = case { "***": 1.0 } of
31− { "***": n } -> n
30+test6 = case { "***": 1.0 } of
31+ { "***": n } -> n
3232
33− test7 {a: snoog , b : blah } = blah
33+test7 {a: snoog , b : blah } = blah
3434
35− main = Debug.Trace.trace "Done"
35+main = Debug.Trace.trace "Done"
examples/passing/OneConstructor.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35data One a = One a
46
57one' (One a) = a
examples/passing/OperatorAssociativity.purs+3−2
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Control.Monad.Eff
45import Debug.Trace
56import Assert
@@ -17,8 +18,8 @@ main = do
1718 assert (not ((negate 1.0) < 0.0) == false)
1819 assert (negate (1.0 + 10.0) == -11.0)
1920 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)
2122 assert (1.0 + 10.0 - 5.0 == 6.0)
2223 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)
2425 trace "Success!"
examples/passing/OperatorInlining.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Debug.Trace
45
56main = do
examples/passing/OperatorSections.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Assert
45
56main = do
examples/passing/Operators.purs+68−67
@@ -1,98 +1,99 @@
11module Main where
22
3− import Control.Monad.Eff
4− import Debug.Trace
3+import Prelude
4+import Control.Monad.Eff
5+import Debug.Trace
56
6− (?!) :: forall a. a -> a -> a
7− (?!) x _ = x
7+(?!) :: forall a. a -> a -> a
8+(?!) x _ = x
89
9− bar :: String -> String -> String
10− bar = \s1 s2 -> s1 ++ s2
10+bar :: String -> String -> String
11+bar = \s1 s2 -> s1 ++ s2
1112
12− test1 :: forall n. (Num n) => n -> n -> (n -> n -> n) -> n
13− test1 x y z = x * y + z x y
13+test1 :: forall n. (Num n) => n -> n -> (n -> n -> n) -> n
14+test1 x y z = x * y + z x y
1415
15− test2 = (\x -> x.foo false) { foo : \_ -> 1.0 }
16+test2 = (\x -> x.foo false) { foo : \_ -> 1.0 }
1617
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))
1819
19− k = \x -> \y -> x
20+k = \x -> \y -> x
2021
21− test4 = 1 `k` 2
22+test4 = 1 `k` 2
2223
23− infixl 5 %%
24+infixl 5 %%
2425
25− (%%) :: Number -> Number -> Number
26− (%%) x y = x * y + y
26+(%%) :: Number -> Number -> Number
27+(%%) x y = x * y + y
2728
28− test5 = 1.0 %% 2.0 %% 3.0
29+test5 = 1.0 %% 2.0 %% 3.0
2930
30− test6 = ((\x -> x) `k` 2.0) 3.0
31+test6 = ((\x -> x) `k` 2.0) 3.0
3132
32− (<+>) :: String -> String -> String
33− (<+>) = \s1 s2 -> s1 ++ s2
33+(<+>) :: String -> String -> String
34+(<+>) = \s1 s2 -> s1 ++ s2
3435
35− test7 = "Hello" <+> "World!"
36+test7 = "Hello" <+> "World!"
3637
37− (@@) :: forall a b. (a -> b) -> a -> b
38− (@@) = \f x -> f x
38+(@@) :: forall a b. (a -> b) -> a -> b
39+(@@) = \f x -> f x
3940
40− foo :: String -> String
41− foo = \s -> s
41+foo :: String -> String
42+foo = \s -> s
4243
43− test8 = foo @@ "Hello World"
44+test8 = foo @@ "Hello World"
4445
45− test9 = Main.foo @@ "Hello World"
46+test9 = Main.foo @@ "Hello World"
4647
47− test10 = "Hello" `Main.bar` "World"
48+test10 = "Hello" `Main.bar` "World"
4849
49− (...) :: forall a. Array a -> Array a -> Array a
50− (...) = \as -> \bs -> as
50+(...) :: forall a. Array a -> Array a -> Array a
51+(...) = \as -> \bs -> as
5152
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]
5354
54− test12 (<%>) a b = a <%> b
55+test12 (<%>) a b = a <%> b
5556
56− test13 = \(<%>) a b -> a <%> b
57+test13 = \(<%>) a b -> a <%> b
5758
58− test14 :: Number -> Number -> Boolean
59− test14 a b = a < b
59+test14 :: Number -> Number -> Boolean
60+test14 a b = a < b
6061
61− test15 :: Number -> Number -> Boolean
62− test15 a b = const false $ a `test14` b
62+test15 :: Number -> Number -> Boolean
63+test15 a b = const false $ a `test14` b
6364
64− test17 :: Number
65− test17 = negate (-1.0)
65+test17 :: Number
66+test17 = negate (-1.0)
6667
67− test18 :: Number
68− test18 = negate $ negate 1.0
68+test18 :: Number
69+test18 = negate $ negate 1.0
6970
70− test19 :: Number
71− test19 = negate $ negate (-1.0)
71+test19 :: Number
72+test19 = negate $ negate (-1.0)
7273
73− test20 :: Number
74− test20 = 1.0 @ 2.0
75− where
76− (@) x y = x + y * y
74+test20 :: Number
75+test20 = 1.0 @ 2.0
76+ where
77+ (@) x y = x + y * y
7778
78− main = do
79− let t1 = test1 1.0 2.0 (\x y -> x + y)
80− let t2 = test2
81− let t3 = test3
82− let t4 = test4
83− let t5 = test5
84− let t6 = test6
85− let t7 = test7
86− let t8 = test8
87− let t9 = test9
88− let t10 = test10
89− let t11 = test11
90− let t12 = test12 k 1.0 2.0
91− let t13 = test13 k 1.0 2.0
92− let t14 = test14 1.0 2.0
93− let t15 = test15 1.0 2.0
94− let t17 = test17
95− let t18 = test18
96− let t19 = test19
97− let t20 = test20
98− trace "Done"
79+main = do
80+ let t1 = test1 1.0 2.0 (\x y -> x + y)
81+ let t2 = test2
82+ let t3 = test3
83+ let t4 = test4
84+ let t5 = test5
85+ let t6 = test6
86+ let t7 = test7
87+ let t8 = test8
88+ let t9 = test9
89+ let t10 = test10
90+ let t11 = test11
91+ let t12 = test12 k 1.0 2.0
92+ let t13 = test13 k 1.0 2.0
93+ let t14 = test14 1.0 2.0
94+ let t15 = test15 1.0 2.0
95+ let t17 = test17
96+ let t18 = test18
97+ let t19 = test19
98+ let t20 = test20
99+ trace "Done"
examples/passing/PartialFunction.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Assert
45
56fn :: Number -> Number
examples/passing/Patterns.purs+15−15
@@ -1,22 +1,22 @@
11module Main where
22
3− import Prelude
3+import Prelude
44
5− test = \x -> case x of
6− { str = "Foo", bool = true } -> true
7− { str = "Bar", bool = b } -> b
8− _ -> false
5+test = \x -> case x of
6+ { str = "Foo", bool = true } -> true
7+ { str = "Bar", bool = b } -> b
8+ _ -> false
99
10− f = \o -> case o of
11− { foo = "Foo" } -> o.bar
12− _ -> 0
10+f = \o -> case o of
11+ { foo = "Foo" } -> o.bar
12+ _ -> 0
1313
14− h = \o -> case o of
15− a@[_,_,_] -> a
16− _ -> []
14+h = \o -> case o of
15+ a@[_,_,_] -> a
16+ _ -> []
1717
18− isDesc :: Array Number -> Boolean
19− isDesc [x, y] | x > y = true
20− isDesc _ = false
18+isDesc :: Array Number -> Boolean
19+isDesc [x, y] | x > y = true
20+isDesc _ = false
2121
22− main = Debug.Trace.trace "Done"
22+main = Debug.Trace.trace "Done"
examples/passing/Person.purs+7−5
@@ -1,9 +1,11 @@
11module Main where
22
3− data Person = Person { name :: String, age :: Number }
3+import Prelude
44
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 }
86
9− main = Debug.Trace.trace "Done"
7+showPerson :: Person -> String
8+showPerson = \p -> case p of
9+ Person o -> o.name ++ ", aged " ++ show o.age
10+
11+main = Debug.Trace.trace "Done"
examples/passing/Rank2Data.purs+18−18
@@ -1,29 +1,29 @@
11module Main where
22
3− import Prelude
3+import Prelude
44
5− data Id = Id forall a. a -> a
5+data Id = Id forall a. a -> a
66
7− runId = \id a -> case id of
8− Id f -> f a
7+runId = \id a -> case id of
8+ Id f -> f a
99
10− data Nat = Nat forall r. r -> (r -> r) -> r
10+data Nat = Nat forall r. r -> (r -> r) -> r
1111
12− runNat = \nat -> case nat of
13− Nat f -> f 0.0 (\n -> n + 1.0)
12+runNat = \nat -> case nat of
13+ Nat f -> f 0.0 (\n -> n + 1.0)
1414
15− zero' = Nat (\zero' _ -> zero')
15+zero' = Nat (\zero' _ -> zero')
1616
17− succ = \n -> case n of
18− Nat f -> Nat (\zero' succ -> succ (f zero' succ))
17+succ = \n -> case n of
18+ Nat f -> Nat (\zero' succ -> succ (f zero' succ))
1919
20− add = \n m -> case n of
21− Nat f -> case m of
22− Nat g -> Nat (\zero' succ -> g (f zero' succ) succ)
20+add = \n m -> case n of
21+ Nat f -> case m of
22+ Nat g -> Nat (\zero' succ -> g (f zero' succ) succ)
2323
24− one' = succ zero'
25− two = succ zero'
26− four = add two two
27− fourNumber = runNat four
24+one' = succ zero'
25+two = succ zero'
26+four = add two two
27+fourNumber = runNat four
2828
29− main = Debug.Trace.trace "Done'"
29+main = Debug.Trace.trace "Done'"
examples/passing/Rank2Object.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Debug.Trace
45
56data Foo = Foo { id :: forall a. a -> a }
examples/passing/Rank2TypeSynonym.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Control.Monad.Eff
45
56type Foo a = forall f. (Monad f) => f a
examples/passing/Rank2Types.purs+6−6
@@ -1,11 +1,11 @@
11module Main where
22
3− import Prelude
3+import Prelude
44
5− test1 :: (forall a. (a -> a)) -> Number
6− test1 = \f -> f 0.0
5+test1 :: (forall a. (a -> a)) -> Number
6+test1 = \f -> f 0.0
77
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
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
1010
11− main = Debug.Trace.trace "Done"
11+main = Debug.Trace.trace "Done"
examples/passing/RebindableSyntax.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35example1 :: String
46example1 = do
57 "Do"
examples/passing/Recursion.purs+6−6
@@ -1,10 +1,10 @@
11module Main where
22
3− import Prelude
3+import Prelude
44
5− fib = \n -> case n of
6− 0.0 -> 1.0
7− 1.0 -> 1.0
8− n -> fib (n - 1.0) + fib (n - 2.0)
5+fib = \n -> case n of
6+ 0.0 -> 1.0
7+ 1.0 -> 1.0
8+ n -> fib (n - 1.0) + fib (n - 2.0)
99
10− main = Debug.Trace.trace "Done"
10+main = Debug.Trace.trace "Done"
examples/passing/ReservedWords.purs+9−7
@@ -1,13 +1,15 @@
11-- See https://github.com/purescript/purescript/issues/606
22module Main where
33
4− o :: { type :: String }
5− o = { type: "o" }
4+import Prelude
65
7− p :: { type :: String }
8− p = o { type = "p" }
6+o :: { type :: String }
7+o = { type: "o" }
98
10− f :: forall r. { type :: String | r } -> String
11− f { type = "p" } = "Done"
9+p :: { type :: String }
10+p = o { type = "p" }
1211
13− main = Debug.Trace.trace $ f { type: p.type, foo: "bar" }
12+f :: forall r. { type :: String | r } -> String
13+f { type = "p" } = "Done"
14+
15+main = Debug.Trace.trace $ f { type: p.type, foo: "bar" }
examples/passing/RowConstructors.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35type Foo = (x :: Number | (y :: Number | (z :: Number)))
46type Bar = (x :: Number, y :: Number, z :: Number)
57type Baz = { w :: Number | Bar }
examples/passing/RowPolyInstanceContext.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35class T s m where
46 state :: (s -> s) -> m Unit
57
examples/passing/ScopedTypeVariables.purs+3−1
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35test1 :: forall a. (a -> a) -> a -> a
46test1 f x = g (g x)
57 where
@@ -15,7 +17,7 @@ test2 = h
1517 g :: b -> b
1618 g y = f (f y)
1719
18−test3 :: Number
20+test3 :: Number
1921test3 = ((\b -> b :: b) :: forall b. b -> b) 0.0
2022
2123test4 :: forall a. (a -> a) -> a -> a
examples/passing/Sequence.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Control.Monad.Eff
45
56data List a = Cons a (List a) | Nil
examples/passing/SequenceDesugared.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Control.Monad.Eff
45
56data List a = Cons a (List a) | Nil
examples/passing/ShadowedRename.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Control.Monad.Eff
45import Debug.Trace
56import Assert
examples/passing/ShadowedTCO.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35runNat f = f 0.0 (\n -> n + 1.0)
46
57zero' z _ = z
examples/passing/ShadowedTCOLet.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35f x y z =
46 let f 1.0 2.0 3.0 = 1.0
57 in f x z y
examples/passing/SignedNumericLiterals.purs+12−10
@@ -1,15 +1,17 @@
11module Main where
22
3− p = 0.5
4− q = 1.0
5− x = -1.0
6− y = -0.5
7− z = 0.5
8− w = 1.0
3+import Prelude
94
10− f :: Number -> Number
11− f x = -x
5+p = 0.5
6+q = 1.0
7+x = -1.0
8+y = -0.5
9+z = 0.5
10+w = 1.0
1211
13− test1 = 2.0 - 1.0
12+f :: Number -> Number
13+f x = -x
1414
15− main = Debug.Trace.trace "Done"
15+test1 = 2.0 - 1.0
16+
17+main = Debug.Trace.trace "Done"
examples/passing/Superclasses1.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35class Su a where
46 su :: a -> a
57
examples/passing/Superclasses2.purs+1
@@ -1,5 +1,6 @@
11module Main where
22
3+import Prelude
34import Prelude.Unsafe (unsafeIndex)
45
56class Su a where
examples/passing/Superclasses3.purs+1−1
@@ -1,7 +1,7 @@
11module Main where
22
3+import Prelude
34import Debug.Trace
4−
55import Control.Monad.Eff
66
77class (Monad m) <= MonadWriter w m where
examples/passing/TCOCase.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35data Data = One | More Data
46
57main = Debug.Trace.trace (from (to 10000.0 One))
examples/passing/Tick.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35test' x = x
46
57main = Debug.Trace.trace "Done"
examples/passing/TopLevelCase.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35gcd :: Number -> Number -> Number
46gcd 0.0 x = x
57gcd x 0.0 = x
examples/passing/TypeClassMemberOrderChange.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35class Test a where
46 fn :: a -> a -> a
57 val :: a
examples/passing/TypeClassesWithOverlappingTypeVariables.purs+6−6
@@ -1,11 +1,11 @@
11module Main where
22
3− import Prelude
3+import Prelude
44
5− data Either a b = Left a | Right b
5+data Either a b = Left a | Right b
66
7− instance functorEither :: Prelude.Functor (Either a) where
8− (<$>) _ (Left x) = Left x
9− (<$>) f (Right y) = Right (f y)
7+instance functorEither :: Prelude.Functor (Either a) where
8+ (<$>) _ (Left x) = Left x
9+ (<$>) f (Right y) = Right (f y)
1010
11− main = Debug.Trace.trace "Done"
11+main = Debug.Trace.trace "Done"
examples/passing/TypeDecl.purs+7−7
@@ -1,12 +1,12 @@
11module Main where
22
3− import Prelude
3+import Prelude
44
5− k :: String -> Number -> String
6− k x y = x
5+k :: String -> Number -> String
6+k x y = x
77
8− iterate :: forall a. Number -> (a -> a) -> a -> a
9− iterate 0.0 f a = a
10− iterate n f a = iterate (n - 1.0) f (f a)
8+iterate :: forall a. Number -> (a -> a) -> a -> a
9+iterate 0.0 f a = a
10+iterate n f a = iterate (n - 1.0) f (f a)
1111
12− main = Debug.Trace.trace "Done"
12+main = Debug.Trace.trace "Done"
examples/passing/TypeSynonymInData.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35type A a = Array a
46
57data Foo a = Foo (A a) | Bar
examples/passing/TypeSynonyms.purs+20−18
@@ -1,25 +1,27 @@
11module Main where
22
3− type Lens a b =
4− { get :: a -> b
5− , set :: a -> b -> a
6− }
3+import Prelude
74
8− composeLenses :: forall a b c. Lens a b -> Lens b c -> Lens a c
9− composeLenses = \l1 -> \l2 ->
10− { get: \a -> l2.get (l1.get a)
11− , set: \a c -> l1.set a (l2.set (l1.get a) c)
12− }
5+type Lens a b =
6+ { get :: a -> b
7+ , set :: a -> b -> a
8+ }
139
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+ }
1515
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 }
20− }
16+type Pair a b = { fst :: a, snd :: b }
2117
22− test1 :: forall a b c. Lens (Pair (Pair a b) c) a
23− test1 = composeLenses fst fst
18+fst :: forall a b. Lens (Pair a b) a
19+fst =
20+ { get: \p -> p.fst
21+ , set: \p a -> { fst: a, snd: p.snd }
22+ }
2423
25− main = Debug.Trace.trace "Done"
24+test1 :: forall a b c. Lens (Pair (Pair a b) c) a
25+test1 = composeLenses fst fst
26+
27+main = Debug.Trace.trace "Done"
examples/passing/TypeWildcards.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35testTopLevel :: _ -> _
46testTopLevel n = n + 1.0
57
examples/passing/TypeWildcardsRecordExtension.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35foo :: forall a. {b :: Number | a} -> {b :: Number | _}
46foo f = f
57
examples/passing/TypedWhere.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35data E a b = L a | R b
46
57data L a = C a (L a) | N
examples/passing/UnderscoreIdent.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35data Data_type = Con_Structor | Con_2 String
46
57type Type_name = Data_type
examples/passing/UnknownInTypeClassLookup.purs+2
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude
4+
35class EQ a b
46
57instance eqAA :: EQ a a
examples/passing/iota.purs+4−4
@@ -1,9 +1,9 @@
11module Main where
22
3− s = \x -> \y -> \z -> x z (y z)
3+s = \x -> \y -> \z -> x z (y z)
44
5− k = \x -> \y -> x
5+k = \x -> \y -> x
66
7− iota = \x -> x s k
7+iota = \x -> x s k
88
9− main = Debug.Trace.trace "Done"
9+main = Debug.Trace.trace "Done"
examples/passing/s.purs+4−2
@@ -1,5 +1,7 @@
11module Main where
22
3− s = \x y z -> x z (y z)
3+import Prelude
44
5− main = Debug.Trace.trace "Done"
5+s = \x y z -> x z (y z)
6+
7+main = Debug.Trace.trace "Done"
psc-make/Main.hs+3−10
@@ -46,13 +46,12 @@ data PSCMakeOptions = PSCMakeOptions
4646 }
4747
4848data InputOptions = InputOptions
49− { ioNoPrelude :: Bool
50− , ioInputFiles :: [FilePath]
49+ { ioInputFiles :: [FilePath]
5150 }
5251
5352compile :: PSCMakeOptions -> IO ()
5453compile (PSCMakeOptions input inputForeign outputDir opts usePrefix) = do
55− moduleFiles <- readInput (InputOptions (P.optionsNoPrelude opts) input)
54+ moduleFiles <- readInput (InputOptions input)
5655 foreignFiles <- forM inputForeign (\inFile -> (inFile,) <$> readFile inFile)
5756 case runWriterT (parseInputs moduleFiles foreignFiles) of
5857 Left errs -> do
@@ -108,11 +107,6 @@ noTco = switch $
108107 long "no-tco"
109108 <> help "Disable tail call optimizations"
110109
111−noPrelude :: Parser Bool
112−noPrelude = switch $
113− long "no-prelude"
114− <> help "Omit the automatic Prelude import"
115−
116110noMagicDo :: Parser Bool
117111noMagicDo = switch $
118112 long "no-magic-do"
@@ -143,8 +137,7 @@ noPrefix = switch $
143137
144138
145139options :: Parser (P.Options P.Make)
146−options = P.Options <$> noPrelude
147− <*> noTco
140+options = P.Options <$> noTco
148141 <*> noMagicDo
149142 <*> pure Nothing
150143 <*> noOpts
psc/Main.hs+3−10
@@ -51,8 +51,7 @@ data PSCOptions = PSCOptions
5151 }
5252
5353data InputOptions = InputOptions
54− { ioNoPrelude :: Bool
55− , ioUseStdIn :: Bool
54+ { ioUseStdIn :: Bool
5655 , ioInputFiles :: [FilePath]
5756 }
5857
@@ -69,7 +68,7 @@ runPSC opts rwe = runWriterT (runReaderT rwe opts)
6968compile :: PSCOptions -> IO ()
7069compile (PSCOptions input inputForeign opts stdin output externs usePrefix) = do
7170 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)
7372 foreignFiles <- forM inputForeign (\inFile -> (inFile,) <$> readFile inFile)
7473 case runWriterT (parseInputs moduleFiles foreignFiles) of
7574 Left errs -> do
@@ -153,11 +152,6 @@ noTco = switch $
153152 long "no-tco"
154153 <> help "Disable tail call optimizations"
155154
156−noPrelude :: Parser Bool
157−noPrelude = switch $
158− long "no-prelude"
159− <> help "Omit the automatic Prelude import"
160−
161155comments :: Parser Bool
162156comments = switch $
163157 short 'c'
@@ -200,8 +194,7 @@ noPrefix = switch $
200194 <> help "Do not include comment header"
201195
202196options :: Parser (P.Options P.Compile)
203−options = P.Options <$> noPrelude
204− <*> noTco
197+options = P.Options <$> noTco
205198 <*> noMagicDo
206199 <*> runMain
207200 <*> noOpts
psci/Make.hs+2−2
@@ -43,7 +43,7 @@ import qualified Language.PureScript.CoreFn as CF
4343import IO (mkdirp)
4444
4545options :: 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
4747
4848modulesDir :: FilePath
4949modulesDir = ".psci_modules" ++ pathSeparator : "node_modules"
@@ -92,7 +92,7 @@ buildMakeActions filePathMap foreigns =
9292 codegen m _ nextVar exts = do
9393 let mn = CF.moduleName m
9494 foreignInclude <- case CF.moduleName m `M.lookup` foreigns of
95− Just path
95+ Just path
9696 | not $ requiresForeign m -> do tell $ P.errorMessage $ P.UnnecessaryFFIModule mn path
9797 return Nothing
9898 | otherwise -> return $ Just $ J.JSApp (J.JSVar "require") [J.JSStringLiteral "./foreign"]
psci/PSCi.hs+3−9
@@ -88,12 +88,6 @@ supportModule =
8888
8989-- File helpers
9090
91−-- |
92−-- Load the necessary modules.
93−--
94−defaultImports :: [ImportedModule]
95−defaultImports = [(P.ModuleName [P.ProperName "Prelude"], P.Implicit, Nothing)]
96−
9791-- |
9892-- Locates the node executable.
9993-- Checks for either @nodejs@ or @node@.
@@ -121,7 +115,7 @@ loadModule filename = do
121115 return $ either (Left . P.prettyPrintMultipleErrors False) (Right . map snd) $ P.parseModulesFromFiles id [(filename, content)]
122116
123117-- |
124−-- Load all modules, including the Prelude
118+-- Load all modules.
125119--
126120loadAllModules :: [FilePath] -> IO (Either P.MultipleErrors [(Either P.RebuildPolicy FilePath, P.Module)])
127121loadAllModules files = do
@@ -452,7 +446,7 @@ handleCommand ResetState = do
452446 files <- psciImportedFilenames <$> PSCI (lift get)
453447 PSCI . lift . modify $ \st -> st
454448 { psciImportedFilenames = files
455− , psciImportedModules = defaultImports
449+ , psciImportedModules = []
456450 , psciLetBindings = []
457451 }
458452 loadAllImportedModules
@@ -498,7 +492,7 @@ loop PSCiOptions{..} = do
498492 case foreignsOrError of
499493 Left errs -> putStrLn (P.prettyPrintMultipleErrors False errs) >> exitFailure
500494 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
502496 outputStrLn prologueMessage
503497 traverse_ (mapM_ (runPSCI . handleCommand)) config
504498 unless (consoleIsDefined (map snd modules)) . outputStrLn $ unlines
psci/tests/Main.hs+1−1
@@ -141,7 +141,7 @@ getPSCiState = do
141141 Left err ->
142142 print err >> exitFailure
143143 Right modules ->
144− let imports = controlMonadSTasST : defaultImports
144+ let imports = [controlMonadSTasST, (P.ModuleName [P.ProperName "Prelude"], P.Implicit, Nothing)]
145145 in return (PSCiState [] imports modules foreigns [] [])
146146
147147controlMonadSTasST :: ImportedModule
src/Language/PureScript.hs+2−18
@@ -97,11 +97,9 @@ compile = compile' initEnvironment
9797compile' :: (Functor m, Applicative m, MonadError MultipleErrors m, MonadWriter MultipleErrors m, MonadReader (Options Compile) m)
9898 => Environment -> [Module] -> m ([CoreFn.Module CoreFn.Ann], Environment, SupplyVar, Externs)
9999compile' env ms = do
100− noPrelude <- asks optionsNoPrelude
101− unless noPrelude (checkPreludeIsDefined ms)
102100 additional <- asks optionsAdditional
103101 mainModuleIdent <- asks (fmap moduleNameFromString . optionsMain)
104− (sorted, _) <- sortModules $ map importPrim $ if noPrelude then ms else map importPrelude ms
102+ (sorted, _) <- sortModules $ map importPrim ms
105103 mapM_ lint sorted
106104 (desugared, nextVar) <- runSupplyT 0 $ desugar sorted
107105 (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
219217 -> [(Either RebuildPolicy FilePath, Module)]
220218 -> m Environment
221219make 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
225221 mapM_ lint sorted
226222 toRebuild <- foldM (\s (Module _ moduleName' _ _) -> do
227223 inputTimestamp <- getInputTimestamp moduleName'
@@ -271,12 +267,6 @@ make MakeActions{..} ms = do
271267 SimpleErrorWrapper (ErrorParsingModule err) -> SimpleErrorWrapper (ErrorParsingExterns err)
272268 _ -> e
273269
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−
280270reverseDependencies :: ModuleGraph -> M.Map ModuleName [ModuleName]
281271reverseDependencies g = combine [ (dep, mn) | (mn, deps) <- g, dep <- deps ]
282272 where
@@ -298,11 +288,5 @@ addDefaultImport toImport m@(Module coms mn decls exps) =
298288importPrim :: Module -> Module
299289importPrim = addDefaultImport (ModuleName [ProperName C.prim])
300290
301−preludeModuleName :: ModuleName
302−preludeModuleName = ModuleName [ProperName C.prelude]
303−
304−importPrelude :: Module -> Module
305−importPrelude = addDefaultImport preludeModuleName
306−
307291version :: Version
308292version = Paths.version
src/Language/PureScript/Docs/ParseAndDesugar.hs+1−4
@@ -57,7 +57,7 @@ parseAndDesugar inputFiles depsFiles callback = do
5757 ms <- throwLeft ParseError eParsed
5858
5959 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
6161 (ms', _) <- throwLeft SortModulesError eSorted
6262
6363 modules <- throwLeft DesugarError (desugar ms')
@@ -93,9 +93,6 @@ addDefaultImport toImport m@(P.Module coms mn decls exps) =
9393importPrim :: P.Module -> P.Module
9494importPrim = addDefaultImport (P.ModuleName [P.ProperName C.prim])
9595
96−importPrelude :: P.Module -> P.Module
97−importPrelude = addDefaultImport (P.ModuleName [P.ProperName C.prelude])
98−
9996desugar :: [P.Module] -> Either P.MultipleErrors [P.Module]
10097desugar = P.evalSupplyT 0 . desugar'
10198 where
src/Language/PureScript/Errors.hs−12
@@ -52,7 +52,6 @@ import qualified Text.Parsec as P
5252data SimpleErrorMessage
5353 = ErrorParsingExterns P.ParseError
5454 | ErrorParsingFFIModule FilePath
55− | ErrorParsingPrelude P.ParseError
5655 | ErrorParsingModule P.ParseError
5756 | MissingFFIModule ModuleName
5857 | MultipleFFIModules ModuleName [FilePath]
@@ -120,7 +119,6 @@ data SimpleErrorMessage
120119 | TransitiveExportError DeclarationRef [DeclarationRef]
121120 | ShadowedName Ident
122121 | WildcardInferredType Type
123− | PreludeNotPresent
124122 deriving (Show)
125123
126124-- |
@@ -161,7 +159,6 @@ errorCode :: ErrorMessage -> String
161159errorCode em = case unwrapErrorMessage em of
162160 (ErrorParsingExterns _) -> "ErrorParsingExterns"
163161 (ErrorParsingFFIModule _) -> "ErrorParsingFFIModule"
164− (ErrorParsingPrelude _) -> "ErrorParsingPrelude"
165162 (ErrorParsingModule _) -> "ErrorParsingModule"
166163 MissingFFIModule{} -> "MissingFFIModule"
167164 MultipleFFIModules{} -> "MultipleFFIModules"
@@ -229,7 +226,6 @@ errorCode em = case unwrapErrorMessage em of
229226 (TransitiveExportError _ _) -> "TransitiveExportError"
230227 (ShadowedName _) -> "ShadowedName"
231228 (WildcardInferredType _) -> "WildcardInferredType"
232− PreludeNotPresent -> "PreludeNotPresent"
233229
234230-- |
235231-- A stack trace for an error
@@ -393,10 +389,6 @@ prettyPrintSingleError full e = prettyPrintErrorMessage <$> onTypesInErrorMessag
393389 goSimple (MultipleFFIModules mn paths) =
394390 paras $ [ line $ "Multiple FFI implementations have been provided for module " ++ show mn ++ ": " ]
395391 ++ map (indent . line) paths
396− goSimple (ErrorParsingPrelude err) =
397− paras [ line "Error parsing prelude: "
398− , indent . line . show $ err
399− ]
400392 goSimple (InvalidExternsFile path) =
401393 paras [ line "Externs file is invalid: "
402394 , indent . line $ path
@@ -553,10 +545,6 @@ prettyPrintSingleError full e = prettyPrintErrorMessage <$> onTypesInErrorMessag
553545 line $ "Name '" ++ show nm ++ "' was shadowed."
554546 goSimple (WildcardInferredType ty) =
555547 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− ]
560548 go (NotYetDefined names err) =
561549 paras [ line $ "The following are not yet defined here: " ++ intercalate ", " (map show names) ++ ":"
562550 , indent $ go err
src/Language/PureScript/Options.hs+3−7
@@ -44,14 +44,10 @@ deriving instance Show (ModeOptions mode)
4444-- The data type of compiler options
4545--
4646data Options mode = Options {
47− -- |
48− -- Disable inclusion of the built in Prelude
49− --
50− optionsNoPrelude :: Bool
5147 -- |
5248 -- Disable tail-call elimination
5349 --
54− , optionsNoTco :: Bool
50+ optionsNoTco :: Bool
5551 -- |
5652 -- Disable inlining of calls to return and bind for the Eff monad
5753 --
@@ -83,10 +79,10 @@ data Options mode = Options {
8379-- Default compiler options
8480--
8581defaultCompileOptions :: 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" [] [])
8783
8884-- |
8985-- Default make options
9086--
9187defaultMakeOptions :: 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 @@
11-- | 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,
33-- | and should not be used in user code.
44-- | The official Prelude can be found at https://github.com/purescript/purescript-prelude
55
@@ -70,7 +70,7 @@ module Prelude
7070
7171 (:) :: forall a. a -> Array a -> Array a
7272 (:) = cons
73−
73+
7474 foreign import concat :: forall a. Array a -> Array a -> Array a
7575
7676 infixr 9 >>>
@@ -222,11 +222,11 @@ module Prelude
222222 instance moduloSemiringUnit :: ModuloSemiring Unit where
223223 (/) _ _ = unit
224224 mod _ _ = unit
225−
225+
226226 foreign import jsMod :: Number -> Number -> Number
227227
228228 infixl 7 %
229−
229+
230230 (%) = jsMod
231231
232232 class (Ring a, ModuloSemiring a) <= DivisionRing a
@@ -466,6 +466,8 @@ module Prelude
466466
467467module Data.Function where
468468
469+ import Prelude
470+
469471 on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
470472 on f g x y = g x `f` g y
471473
@@ -536,15 +538,16 @@ module Data.Function where
536538 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
537539
538540module Assert where
539−
541+
542+ import Prelude
540543 import Control.Monad.Eff
541−
544+
542545 foreign import data Assert :: !
543−
546+
544547 foreign import error :: forall a. String -> a
545−
548+
546549 foreign import assertPartial :: forall e a. (Unit -> a) -> Eff (assert :: Assert | e) Unit
547−
550+
548551 assert :: forall e. Boolean -> Eff (assert :: Assert | e) Unit
549552 assert true = return unit
550553 assert false = error "Assertion failed!"
@@ -560,6 +563,8 @@ module Control.Monad.Eff
560563 , untilE, whileE
561564 ) where
562565
566+ import Prelude
567+
563568 foreign import data Eff :: # ! -> * -> *
564569
565570 foreign import returnE :: forall e a. a -> Eff e a
@@ -583,13 +588,14 @@ module Control.Monad.Eff
583588 (>>=) = bindE
584589
585590 instance monadEff :: Monad (Eff e)
586−
591+
587592 foreign import untilE :: forall e. Eff e Boolean -> Eff e Unit
588−
593+
589594 foreign import whileE :: forall e a. Eff e Boolean -> Eff e a -> Eff e Unit
590595
591596module Debug.Trace where
592597
598+ import Prelude
593599 import Control.Monad.Eff
594600
595601 foreign import data Trace :: !
@@ -601,6 +607,7 @@ module Debug.Trace where
601607
602608module Control.Monad.ST where
603609
610+ import Prelude
604611 import Control.Monad.Eff
605612
606613 foreign import data ST :: * -> !