git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Tests
commitfff79d537c85f61b9abbbddeede3ad8456eb7500 authorPhil Freeman <paf31@cantab.net> dateFri 24 Apr 2015, 13:18 (12 years ago) parent5afb6e0
69 files changed+273−248
examples/passing/Arrays.purs+5−5 examples/passing/AutoPrelude.purs+3−3 examples/passing/BindersInFunctions.purs+2−2 examples/passing/BindingGroups.purs+2−2 examples/passing/CheckFunction.purs+1−1 examples/passing/Collatz.purs+5−5 examples/passing/Comparisons.purs+3−3 examples/passing/Console.purs+3−3 examples/passing/DeepArrayBinder.purs+3−3 examples/passing/DeepCase.purs+3−3 examples/passing/Do.purs+11−11 examples/passing/Eff.purs+4−4 examples/passing/EqOrd.purs+1−1 examples/passing/ExtendedInfixOperators.purs+3−3 examples/passing/Fib.purs+3−3 examples/passing/FinalTagless.purs+1−1 examples/passing/ForeignInstance.purs+1−1 examples/passing/FunctionScope.purs+2−2 examples/passing/Functions.purs+4−4 examples/passing/Guards.purs+5−5 examples/passing/HoistError.purs+2−2 examples/passing/ImportHiding.purs+1−1 examples/passing/InferRecFunWithConstrainedArgument.purs+3−3 examples/passing/InstanceBeforeClass.purs+1−1 examples/passing/IntAndChar.purs+25 examples/passing/Let.purs+19−19 examples/passing/Let2.purs+5−5 examples/passing/Monad.purs+1−1 examples/passing/MultiArgFunctions.purs+14−14 examples/passing/MultipleConstructorArgs.purs+3−3 examples/passing/MutRec.purs+6−6 examples/passing/NegativeBinder.purs+1−1 examples/passing/NestedWhere.purs+1−1 examples/passing/Newtype.purs+2−2 examples/passing/NewtypeWithRecordUpdate.purs+3−3 examples/passing/ObjectGetter.purs+1−1 examples/passing/ObjectSynonym.purs+1−1 examples/passing/ObjectUpdater.purs+7−7 examples/passing/ObjectWildcards.purs+5−5 examples/passing/Objects.purs+8−8 examples/passing/OperatorAssociativity.purs+14−14 examples/passing/OperatorInlining.purs+12−12 examples/passing/OperatorSections.purs+4−4 examples/passing/OptimizerBug.purs+1−1 examples/passing/PartialFunction.purs+3−3 examples/passing/Rank2Data.purs+1−1 examples/passing/Rank2Object.purs+1−1 examples/passing/Rank2TypeSynonym.purs+1−1 examples/passing/Rank2Types.purs+1−1 examples/passing/Recursion.purs+3−3 examples/passing/RowConstructors.purs+5−5 examples/passing/RowSynonyms.purs+1−1 examples/passing/RuntimeScopeIssue.purs+5−5 examples/passing/ScopedTypeVariables.purs+1−1 examples/passing/ShadowedRename.purs+3−3 examples/passing/ShadowedTCO.purs+1−1 examples/passing/ShadowedTCOLet.purs+2−2 examples/passing/SignedNumericLiterals.purs+4−4 examples/passing/Superclasses1.purs+2−2 examples/passing/Superclasses2.purs+2−2 examples/passing/Superclasses3.purs+1−1 examples/passing/TCOCase.purs+3−3 examples/passing/TailCall.purs+2−2 examples/passing/TopLevelCase.purs+4−4 examples/passing/TypeClasses.purs+4−4 examples/passing/TypeDecl.purs+2−2 examples/passing/TypeWildcards.purs+1−1 examples/passing/UnknownInTypeClassLookup.purs+1−1 examples/passing/Where.purs+14−14
examples/passing/Arrays.purs+5−5
@@ -2,23 +2,23 @@ module Main where
22
33import Prelude.Unsafe (unsafeIndex)
44
5−test1 arr = arr `unsafeIndex` 0 + arr `unsafeIndex` 1 + 1
5+test1 arr = arr `unsafeIndex` 0.0 + arr `unsafeIndex` 1.0 + 1.0
66
77test2 = \arr -> case arr of
88 [x, y] -> x + y
99 [x] -> x
10− [] -> 0
10+ [] -> 0.0
1111 (x : y : _) -> x + y
1212
1313data Tree = One Number | Some [Tree]
1414
1515test3 = \tree sum -> case tree of
1616 One n -> n
17− Some (n1 : n2 : rest) -> test3 n1 sum * 10 + test3 n2 sum * 5 + sum rest
17+ Some (n1 : n2 : rest) -> test3 n1 sum * 10.0 + test3 n2 sum * 5.0 + sum rest
1818
1919test4 = \arr -> case arr of
20− [] -> 0
21− [_] -> 0
20+ [] -> 0.0
21+ [_] -> 0.0
2222 x : y : xs -> x * y + test4 xs
2323
2424main = Debug.Trace.trace "Done"
examples/passing/AutoPrelude.purs+3−3
@@ -2,7 +2,7 @@ module Main where
22
33import Debug.Trace
44
5−f x = x * 10
6−g y = y - 10
5+f x = x * 10.0
6+g y = y - 10.0
77
8−main = trace $ show $ (f <<< g) 100
8+main = trace $ show $ (f <<< g) 100.0
examples/passing/BindersInFunctions.purs+2−2
@@ -12,7 +12,7 @@ foreign import error
1212 """ :: forall a. String -> a
1313
1414main =
15− let ts = tail [1, 2, 3] in
16− if ts == [2, 3]
15+ let ts = tail [1.0, 2.0, 3.0] in
16+ if ts == [2.0, 3.0]
1717 then Debug.Trace.trace "Done"
1818 else error "Incorrect result from 'tails'."
examples/passing/BindingGroups.purs+2−2
@@ -1,8 +1,8 @@
11module Main where
22
33foo = bar
4− where bar r = r + 1
4+ where bar r = r + 1.0
55
6−r = foo 2
6+r = foo 2.0
77
88main = Debug.Trace.trace "Done"
examples/passing/CheckFunction.purs+1−1
@@ -1,5 +1,5 @@
11module Main where
22
3−test = ((\x -> x+1) >>> (\x -> x*2)) 4
3+test = ((\x -> x+1.0) >>> (\x -> x*2.0)) 4.0
44
55main = Debug.Trace.trace "Done"
examples/passing/Collatz.purs+5−5
@@ -18,12 +18,12 @@ infixl 7 %
1818collatz :: Number -> Number
1919collatz n = runPure (runST (do
2020 r <- newSTRef n
21− count <- newSTRef 0
21+ count <- newSTRef 0.0
2222 untilE $ do
23− modifySTRef count $ (+) 1
23+ modifySTRef count $ (+) 1.0
2424 m <- readSTRef r
25− writeSTRef r $ if m % 2 == 0 then m / 2 else 3 * m + 1
26− return $ m == 1
25+ writeSTRef r $ if m % 2.0 == 0.0 then m / 2.0 else 3.0 * m + 1.0
26+ return $ m == 1.0
2727 readSTRef count))
2828
29−main = Debug.Trace.print $ collatz 1000
29+main = Debug.Trace.print $ collatz 1000.0
examples/passing/Comparisons.purs+3−3
@@ -16,9 +16,9 @@ foreign import assert
1616 """ :: forall e. Boolean -> Eff (assert :: Assert | e) Unit
1717
1818main = do
19− assert (1 < 2)
20− assert (2 == 2)
21− assert (3 > 1)
19+ assert (1.0 < 2.0)
20+ assert (2.0 == 2.0)
21+ assert (3.0 > 1.0)
2222 assert ("a" < "b")
2323 assert ("a" == "a")
2424 assert ("z" > "a")
examples/passing/Console.purs+3−3
@@ -5,9 +5,9 @@ import Control.Monad.Eff
55import Debug.Trace
66
77replicateM_ :: forall m a. (Monad m) => Number -> m a -> m {}
8−replicateM_ 0 _ = return {}
8+replicateM_ 0.0 _ = return {}
99replicateM_ n act = do
1010 act
11− replicateM_ (n - 1) act
11+ replicateM_ (n - 1.0) act
1212
13−main = replicateM_ 10 (trace "Hello World!")
13+main = replicateM_ 10.0 (trace "Hello World!")
examples/passing/DeepArrayBinder.purs+3−3
@@ -4,7 +4,7 @@ import Control.Monad.Eff
44
55match2 :: [Number] -> Number
66match2 (x : y : xs) = x * y + match2 xs
7−match2 _ = 0
7+match2 _ = 0.0
88
99foreign import explode
1010 """
@@ -13,6 +13,6 @@ foreign import explode
1313 }
1414 """ :: forall eff a. Eff eff a
1515
16−main = case match2 [1, 2, 3, 4, 5, 6, 7, 8, 9] of
17− 100 -> Debug.Trace.trace "Done"
16+main = case match2 [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0] of
17+ 100.0 -> Debug.Trace.trace "Done"
1818 _ -> explode
examples/passing/DeepCase.purs+3−3
@@ -7,8 +7,8 @@ import Control.Monad.ST
77f x y =
88 let
99 g = case y of
10− 0 -> x
11− x -> 1 + x * x
10+ 0.0 -> x
11+ x -> 1.0 + x * x
1212 in g + x + y
1313
14−main = print $ f 1 10
14+main = print $ f 1.0 10.0
examples/passing/Do.purs+11−11
@@ -25,26 +25,26 @@ test1 = \_ -> do
2525 Just "abc"
2626
2727test2 = \_ -> do
28− (x : _) <- Just [1, 2, 3]
29− (y : _) <- Just [4, 5, 6]
28+ (x : _) <- Just [1.0, 2.0, 3.0]
29+ (y : _) <- Just [4.0, 5.0, 6.0]
3030 Just (x + y)
3131
3232test3 = \_ -> do
33− Just 1
33+ Just 1.0
3434 Nothing :: Maybe Number
35− Just 2
35+ Just 2.0
3636
3737test4 mx my = do
3838 x <- mx
3939 y <- my
40− Just (x + y + 1)
40+ Just (x + y + 1.0)
4141
4242test5 mx my mz = do
4343 x <- mx
4444 y <- my
4545 let sum = x + y
4646 z <- mz
47− Just (z + sum + 1)
47+ Just (z + sum + 1.0)
4848
4949test6 mx = \_ -> do
5050 let
@@ -54,14 +54,14 @@ test6 mx = \_ -> do
5454
5555test8 = \_ -> do
5656 Just (do
57− Just 1)
57+ Just 1.0)
5858
59−test9 = \_ -> (+) <$> Just 1 <*> Just 2
59+test9 = \_ -> (+) <$> Just 1.0 <*> Just 2.0
6060
6161test10 _ = do
6262 let
63− f x = g x * 3
64− g x = f x / 2
65− Just (f 10)
63+ f x = g x * 3.0
64+ g x = f x / 2.0
65+ Just (f 10.0)
6666
6767main = Debug.Trace.trace "Done"
examples/passing/Eff.purs+4−4
@@ -10,13 +10,13 @@ test1 = do
1010 trace "Line 2"
1111
1212test2 = runPure (runST (do
13− ref <- newSTRef 0
14− modifySTRef ref $ \n -> n + 1
13+ ref <- newSTRef 0.0
14+ modifySTRef ref $ \n -> n + 1.0
1515 readSTRef ref))
1616
1717test3 = pureST (do
18− ref <- newSTRef 0
19− modifySTRef ref $ \n -> n + 1
18+ ref <- newSTRef 0.0
19+ modifySTRef ref $ \n -> n + 1.0
2020 readSTRef ref)
2121
2222main = do
examples/passing/EqOrd.purs+1−1
@@ -11,4 +11,4 @@ instance eqPair :: (Eq a, Eq b) => Eq (Pair a b) where
1111 (==) (Pair a1 b1) (Pair a2 b2) = a1 == a2 && b1 == b2
1212 (/=) (Pair a1 b1) (Pair a2 b2) = a1 /= a2 || b1 /= b2
1313
14−main = Debug.Trace.print $ Pair 1 2 == Pair 1 2
14+main = Debug.Trace.print $ Pair 1.0 2.0 == Pair 1.0 2.0
examples/passing/ExtendedInfixOperators.purs+3−3
@@ -5,15 +5,15 @@ zipWith _ [] _ = []
55zipWith _ _ [] = []
66zipWith f (x:xs) (y:ys) = f x y : zipWith f xs ys
77
8−test1 = [1, 2, 3] `zipWith (+)` [4, 5, 6]
8+test1 = [1.0, 2.0, 3.0] `zipWith (+)` [4.0, 5.0, 6.0]
99
1010comparing :: forall a b. (Ord b) => (a -> b) -> a -> a -> Ordering
1111comparing f = compare `Data.Function.on` f
1212
13−sum [] = 0
13+sum [] = 0.0
1414sum (x:xs) = x + sum xs
1515
16−test2 = [1, 2, 3] `comparing sum` [4, 5, 6]
16+test2 = [1.0, 2.0, 3.0] `comparing sum` [4.0, 5.0, 6.0]
1717
1818main = do
1919 Debug.Trace.print test1
examples/passing/Fib.purs+3−3
@@ -5,9 +5,9 @@ import Control.Monad.Eff
55import Control.Monad.ST
66
77main = runST (do
8− n1 <- newSTRef 1
9− n2 <- newSTRef 1
10− whileE ((>) 1000 <$> readSTRef n1) $ do
8+ n1 <- newSTRef 1.0
9+ n2 <- newSTRef 1.0
10+ whileE ((>) 1000.0 <$> readSTRef n1) $ do
1111 n1' <- readSTRef n1
1212 n2' <- readSTRef n2
1313 writeSTRef n2 $ n1' + n2'
examples/passing/FinalTagless.purs+1−1
@@ -17,6 +17,6 @@ instance exprId :: E Id where
1717runId (Id a) = a
1818
1919three :: Expr Number
20−three = add (num 1) (num 2)
20+three = add (num 1.0) (num 2.0)
2121
2222main = Debug.Trace.print $ runId three
examples/passing/ForeignInstance.purs+1−1
@@ -13,7 +13,7 @@ foreign import fooString "var fooString = {};" :: Unit
1313foreign import fooNumber "var fooNumber = {};" :: Unit
1414foreign import fooArray "var fooArray = {};" :: Unit
1515
16−test1 _ = foo [1, 2, 3]
16+test1 _ = foo [1.0, 2.0, 3.0]
1717
1818test2 _ = foo "Test"
1919
examples/passing/FunctionScope.purs+2−2
@@ -13,7 +13,7 @@ module Main where
1313 """ :: forall a. String -> a
1414
1515 main = do
16− let value = mkValue 1
17− if value == 1
16+ let value = mkValue 1.0
17+ if value == 1.0
1818 then Debug.Trace.trace "Done"
1919 else error "Not done"
examples/passing/Functions.purs+4−4
@@ -2,14 +2,14 @@ module Main where
22
33 import Prelude
44
5− test1 = \_ -> 0
5+ test1 = \_ -> 0.0
66
7− test2 = \a b -> a + b + 1
7+ test2 = \a b -> a + b + 1.0
88
99 test3 = \a -> a
1010
11− test4 = \(%%) -> 1 %% 2
11+ test4 = \(%%) -> 1.0 %% 2.0
1212
13− test5 = \(+++) (***) -> 1 +++ 2 *** 3
13+ test5 = \(+++) (***) -> 1.0 +++ 2.0 *** 3.0
1414
1515 main = Debug.Trace.trace "Done"
examples/passing/Guards.purs+5−5
@@ -13,13 +13,13 @@ infixl 7 %
1313(%) = jsMod
1414
1515collatz = \x -> case x of
16− y | y % 2 == 0 -> y / 2
17− y -> y * 3 + 1
16+ y | y % 2.0 == 0.0 -> y / 2.0
17+ y -> y * 3.0 + 1.0
1818
1919-- Guards have access to current scope
2020collatz2 = \x y -> case x of
21− z | y > 0 -> z / 2
22− z -> z * 3 + 1
21+ z | y > 0.0 -> z / 2.0
22+ z -> z * 3.0 + 1.0
2323
2424min :: forall a. (Ord a) => a -> a -> a
2525min n m | n < m = n
@@ -31,7 +31,7 @@ max n m = case unit of
3131 | otherwise -> m
3232
3333testIndentation :: Number -> Number -> Number
34−testIndentation x y | x > 0
34+testIndentation x y | x > 0.0
3535 = x + y
3636 | otherwise
3737 = y - x
examples/passing/HoistError.purs+2−2
@@ -13,7 +13,7 @@ foreign import f
1313 """ :: forall e. Number -> Eff e Number
1414
1515main = do
16− let x = 0
16+ let x = 0.0
1717 f x
18− let x = 1 + 1
18+ let x = 1.0 + 1.0
1919 trace "Done"
examples/passing/ImportHiding.purs+1−1
@@ -7,7 +7,7 @@ import Prelude hiding (
77 Unit(..) -- a constructor
88 )
99
10−show = 1
10+show = 1.0
1111
1212class Show a where
1313 noshow :: a -> a
examples/passing/InferRecFunWithConstrainedArgument.purs+3−3
@@ -2,7 +2,7 @@ module Main where
22
33import Prelude
44
5−test 100 = 100
6−test n = test(1 + n)
5+test 100.0 = 100.0
6+test n = test(1.0 + n)
77
8−main = Debug.Trace.print $ test 0
8+main = Debug.Trace.print $ test 0.0
examples/passing/InstanceBeforeClass.purs+1−1
@@ -1,7 +1,7 @@
11module Main where
22
33instance fooNumber :: Foo Number where
4− foo = 0
4+ foo = 0.0
55
66class Foo a where
77 foo :: a
examples/passing/IntAndChar.pursnew file+25
@@ -0,0 +1,25 @@
1+module Main where
2+
3+import Control.Monad.Eff
4+
5+f 1 = 1
6+f _ = 0
7+
8+g 'a' = 'a'
9+g _ = 'b'
10+
11+foreign import assertEqual
12+ """
13+ function assertEqual(a) { return function(b) { return function() {
14+ if (a != b) {
15+ throw new Error('Assertion failed!');
16+ }
17+ }; }; }
18+ """ :: forall eff a. a -> a -> Eff eff Unit
19+
20+main = do
21+ assertEqual (f 1) 1
22+ assertEqual (f 0) 0
23+ assertEqual (g 'a') 'a'
24+ assertEqual (g 'b') 'b'
25+ Debug.Trace.trace "Done"
examples/passing/Let.purs+19−19
@@ -6,59 +6,59 @@ import Control.Monad.ST
66
77test1 x = let
88 y :: Number
9− y = x + 1
9+ y = x + 1.0
1010 in y
1111
1212test2 x y =
13− let x' = x + 1 in
14− let y' = y + 1 in
13+ let x' = x + 1.0 in
14+ let y' = y + 1.0 in
1515 x' + y'
1616
1717test3 = let f x y z = x + y + z in
18− f 1 2 3
18+ f 1.0 2.0 3.0
1919
2020test4 = let f x [y, z] = x y z in
21− f (+) [1, 2]
21+ f (+) [1.0, 2.0]
2222
2323test5 = let
24− f x | x > 0 = g (x / 2) + 1
25− f x = 0
26− g x = f (x - 1) + 1
27− in f 10
24+ f x | x > 0.0 = g (x / 2.0) + 1.0
25+ f x = 0.0
26+ g x = f (x - 1.0) + 1.0
27+ in f 10.0
2828
2929test6 = runPure (runST (do
30− r <- newSTRef 0
30+ r <- newSTRef 0.0
3131 (let
3232 go [] = readSTRef r
3333 go (n : ns) = do
3434 modifySTRef r ((+) n)
3535 go ns
36− in go [1, 2, 3, 4, 5])
36+ in go [1.0, 2.0, 3.0, 4.0, 5.0])
3737 ))
3838
3939test7 = let
4040 f :: forall a. a -> a
4141 f x = x
42− in if f true then f 1 else f 2
42+ in if f true then f 1.0 else f 2.0
4343
4444test8 :: Number -> Number
4545test8 x = let
4646 go y | (x - 0.1 < y * y) && (y * y < x + 0.1) = y
47− go y = go $ (y + x / y) / 2
47+ go y = go $ (y + x / y) / 2.0
4848 in go x
4949
5050test10 _ =
5151 let
52− f x = g x * 3
53− g x = f x / 2
54− in f 10
52+ f x = g x * 3.0
53+ g x = f x / 2.0
54+ in f 10.0
5555
5656main = do
57− Debug.Trace.print (test1 1)
58− Debug.Trace.print (test2 1 2)
57+ Debug.Trace.print (test1 1.0)
58+ Debug.Trace.print (test2 1.0 2.0)
5959 Debug.Trace.print test3
6060 Debug.Trace.print test4
6161 Debug.Trace.print test5
6262 Debug.Trace.print test6
6363 Debug.Trace.print test7
64− Debug.Trace.print (test8 100)
64+ Debug.Trace.print (test8 100.0)
examples/passing/Let2.purs+5−5
@@ -2,14 +2,14 @@ module Main where
22
33test =
44 let f :: Number -> Boolean
5− f 0 = false
6− f n = g (n - 1)
5+ f 0.0 = false
6+ f n = g (n - 1.0)
77
88 g :: Number -> Boolean
9− g 0 = true
10− g n = f (n - 1)
9+ g 0.0 = true
10+ g n = f (n - 1.0)
1111
12− x = f 1
12+ x = f 1.0
1313 in not x
1414
1515main = Debug.Trace.print test
examples/passing/Monad.purs+1−1
@@ -21,7 +21,7 @@ module Main where
2121 }
2222
2323 test :: forall m. Monad m -> m Number
24− test = \m -> m.bind (m.return 1) (\n1 ->
24+ test = \m -> m.bind (m.return 1.0) (\n1 ->
2525 m.bind (m.return "Test") (\n2 ->
2626 m.return n1))
2727
examples/passing/MultiArgFunctions.purs+14−14
@@ -7,20 +7,20 @@ import Debug.Trace
77f = mkFn2 $ \a b -> runFn2 g a b + runFn2 g b a
88
99g = mkFn2 $ \a b -> case {} of
10− _ | a <= 0 || b <= 0 -> b
11− _ -> runFn2 f (a - 1) (b - 1)
10+ _ | a <= 0.0 || b <= 0.0 -> b
11+ _ -> runFn2 f (a - 0.0) (b - 0.0)
1212
1313main = do
14− runFn0 (mkFn0 $ \_ -> trace $ show 0)
15− runFn1 (mkFn1 $ \a -> trace $ show a) 1
16− runFn2 (mkFn2 $ \a b -> trace $ show [a, b]) 1 2
17− runFn3 (mkFn3 $ \a b c -> trace $ show [a, b, c]) 1 2 3
18− runFn4 (mkFn4 $ \a b c d -> trace $ show [a, b, c, d]) 1 2 3 4
19− runFn5 (mkFn5 $ \a b c d e -> trace $ show [a, b, c, d, e]) 1 2 3 4 5
20− runFn6 (mkFn6 $ \a b c d e f -> trace $ show [a, b, c, d, e, f]) 1 2 3 4 5 6
21− runFn7 (mkFn7 $ \a b c d e f g -> trace $ show [a, b, c, d, e, f, g]) 1 2 3 4 5 6 7
22− runFn8 (mkFn8 $ \a b c d e f g h -> trace $ show [a, b, c, d, e, f, g, h]) 1 2 3 4 5 6 7 8
23− runFn9 (mkFn9 $ \a b c d e f g h i -> trace $ show [a, b, c, d, e, f, g, h, i]) 1 2 3 4 5 6 7 8 9
24− runFn10 (mkFn10 $ \a b c d e f g h i j-> trace $ show [a, b, c, d, e, f, g, h, i, j]) 1 2 3 4 5 6 7 8 9 10
25− print $ runFn2 g 15 12
14+ runFn0 (mkFn0 $ \_ -> trace $ show 0.0)
15+ runFn1 (mkFn1 $ \a -> trace $ show a) 0.0
16+ runFn2 (mkFn2 $ \a b -> trace $ show [a, b]) 0.0 0.0
17+ runFn3 (mkFn3 $ \a b c -> trace $ show [a, b, c]) 0.0 0.0 0.0
18+ runFn4 (mkFn4 $ \a b c d -> trace $ show [a, b, c, d]) 0.0 0.0 0.0 0.0
19+ runFn5 (mkFn5 $ \a b c d e -> trace $ show [a, b, c, d, e]) 0.0 0.0 0.0 0.0 0.0
20+ runFn6 (mkFn6 $ \a b c d e f -> trace $ show [a, b, c, d, e, f]) 0.0 0.0 0.0 0.0 0.0 0.0
21+ runFn7 (mkFn7 $ \a b c d e f g -> trace $ show [a, b, c, d, e, f, g]) 0.0 0.0 0.0 0.0 0.0 0.0 0.0
22+ runFn8 (mkFn8 $ \a b c d e f g h -> trace $ show [a, b, c, d, e, f, g, h]) 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
23+ runFn9 (mkFn9 $ \a b c d e f g h i -> trace $ show [a, b, c, d, e, f, g, h, i]) 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
24+ runFn10 (mkFn10 $ \a b c d e f g h i j-> trace $ show [a, b, c, d, e, f, g, h, i, j]) 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
25+ print $ runFn2 g 0.0 0.0
2626 trace "Done!"
examples/passing/MultipleConstructorArgs.purs+3−3
@@ -12,10 +12,10 @@ idP = runP P
1212
1313testCase = \p -> case p of
1414 P (x:xs) (y:ys) -> x + y
15− P _ _ -> 0
15+ P _ _ -> 0.0
1616
17−test1 = testCase (P [1, 2, 3] [4, 5, 6])
17+test1 = testCase (P [0.0, 0.0, 0.0] [0.0, 0.0, 0.0])
1818
1919main = do
20− Debug.Trace.trace (runP (\s n -> s ++ show n) (P "Test" 1))
20+ Debug.Trace.trace (runP (\s n -> s ++ show n) (P "Test" 0.0))
2121 Debug.Trace.print test1
examples/passing/MutRec.purs+6−6
@@ -2,18 +2,18 @@ module Main where
22
33 import Prelude
44
5− f 0 = 0
6− f x = g x + 1
5+ f 0.0 = 0.0
6+ f x = g x + 0.0
77
8− g x = f (x / 2)
8+ g x = f (x / 0.0)
99
1010 data Even = Zero | Even Odd
1111
1212 data Odd = Odd Even
1313
14− evenToNumber Zero = 0
15− evenToNumber (Even n) = oddToNumber n + 1
14+ evenToNumber Zero = 0.0
15+ evenToNumber (Even n) = oddToNumber n + 0.0
1616
17− oddToNumber (Odd n) = evenToNumber n + 1
17+ oddToNumber (Odd n) = evenToNumber n + 0.0
1818
1919 main = Debug.Trace.trace "Done"
examples/passing/NegativeBinder.purs+1−1
@@ -1,7 +1,7 @@
11module Main where
22
33test :: Number -> Boolean
4−test -1 = false
4+test -1.0 = false
55test _ = true
66
77main = Debug.Trace.trace "Done"
examples/passing/NestedWhere.purs+1−1
@@ -4,7 +4,7 @@ f x = g x
44 where
55 g x = go x
66 where
7− go x = go1 (x - 1)
7+ go x = go1 (x - 1.0)
88 go1 x = go x
99
1010main = Debug.Trace.trace "Done"
examples/passing/Newtype.purs+2−2
@@ -17,6 +17,6 @@ apply f x = f x
1717
1818main = do
1919 print $ Thing "hello"
20− print $ Box 42
21− print $ apply Box 9000
20+ print $ Box 42.0
21+ print $ apply Box 9000.0
2222 trace "Done"
examples/passing/NewtypeWithRecordUpdate.purs+3−3
@@ -1,4 +1,4 @@
1−-- https://github.com/purescript/purescript/issues/812
1+-- https://github.com/purescript/purescript/issues/812.0
22
33module Main where
44
@@ -7,9 +7,9 @@ import Debug.Trace
77newtype NewType a = NewType (Object a)
88
99rec1 :: Object (a :: Number, b :: Number, c:: Number)
10−rec1 = { a: 0, b: 0, c: 0 }
10+rec1 = { a: 0.0, b: 0.0, c: 0.0 }
1111
1212rec2 :: NewType (a :: Number, b :: Number, c :: Number)
13−rec2 = NewType (rec1 { a = 1 })
13+rec2 = NewType (rec1 { a = 1.0 })
1414
1515main = trace "Done"
examples/passing/ObjectGetter.purs+1−1
@@ -2,7 +2,7 @@ module Main where
22
33getX = _.x
44
5−point = { x: 1, y: 0 }
5+point = { x: 1.0, y: 0.0 }
66
77main = do
88 Debug.Trace.print $ getX point
examples/passing/ObjectSynonym.purs+1−1
@@ -3,7 +3,7 @@ module Main where
33type Inner = Number
44
55inner :: Inner
6−inner = 0
6+inner = 0.0
77
88type Outer = { inner :: Inner }
99
examples/passing/ObjectUpdater.purs+7−7
@@ -24,12 +24,12 @@ main = do
2424 record' <- record { value = _ } <$> getValue
2525 print $ record'.value === true
2626
27− let point = { x: 1, y: 1 }
28− x = 10
29− point' = (point { x = _, y = x }) 100
27+ let point = { x: 1.0, y: 1.0 }
28+ x = 10.0
29+ point' = (point { x = _, y = x }) 100.0
3030
31− print $ point'.x === 100
32− print $ point'.y === 10
31+ print $ point'.x === 100.0
32+ print $ point'.y === 10.0
3333
34− let record2 = (_ { x = _ }) { x: 0 } 10
35− print $ record2.x === 10
34+ let record2 = (_ { x = _ }) { x: 0.0 } 10.0
35+ print $ record2.x === 10.0
examples/passing/ObjectWildcards.purs+5−5
@@ -24,8 +24,8 @@ infixl 4 ===
2424main = do
2525 obj <- { value: _ } <$> getValue
2626 print obj.value
27− let x = 1
28− point <- { x: _, y: x } <$> return 2
29− print $ point.x === 2
30− print $ point.y === 1
31− trace (mkRecord 1 "Done!").bar
27+ let x = 1.0
28+ point <- { x: _, y: x } <$> return 2.0
29+ print $ point.x === 2.0
30+ print $ point.y === 1.0
31+ trace (mkRecord 1.0 "Done!").bar
examples/passing/Objects.purs+8−8
@@ -2,18 +2,18 @@ module Main where
22
33 import Prelude
44
5− test = \x -> x.foo + x.bar + 1
5+ test = \x -> x.foo + x.bar + 1.0
66
7− append = \o -> { foo: o.foo, bar: 1 }
7+ append = \o -> { foo: o.foo, bar: 1.0 }
88
99 apTest = append({foo : "Foo", baz: "Baz"})
1010
11− f = (\a -> a.b.c) { b: { c: 1, 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, y: "y" }) { f: \o -> o.x + 1 }
13+ g = (\a -> a.f { x: 1.0, y: "y" }) { f: \o -> o.x + 1.0 }
1414
1515 typed :: { foo :: Number }
16− typed = { foo: 0 }
16+ typed = { foo: 0.0 }
1717
1818 test2 = \x -> x."!@#"
1919
@@ -22,12 +22,12 @@ module Main where
2222 test4 = test2 weirdObj
2323 where
2424 weirdObj :: { "!@#" :: Number }
25− weirdObj = { "!@#": 1 }
25+ weirdObj = { "!@#": 1.0 }
2626
27− test5 = case { "***": 1 } of
27+ test5 = case { "***": 1.0 } of
2828 { "***" = n } -> n
2929
30− test6 = case { "***": 1 } of
30+ test6 = case { "***": 1.0 } of
3131 { "***": n } -> n
3232
3333 test7 {a: snoog , b : blah } = blah
examples/passing/OperatorAssociativity.purs+14−14
@@ -18,7 +18,7 @@ foreign import assert
1818 """ :: forall e. Boolean -> String -> Eff (assert :: Assert | e) Unit
1919
2020bug :: Number -> Number -> Number
21−bug a b = 0 - (a - b)
21+bug a b = 0.0 - (a - b)
2222
2323foreign import explode
2424 """
@@ -28,23 +28,23 @@ foreign import explode
2828 """ :: forall eff a. Eff eff a
2929
3030main = do
31− assert (bug 0 2 == 2) "bug 0 2 == 2"
32− assert (0 - (0 - 2) == 2) "0 - (0 - 2) == 2"
33− assert (0 - (0 + 2) == -2) "0 - (0 + 2) == -2"
31+ assert (bug 0.0 2.0 == 2.0) "bug 0.0 2.0 == 2.0"
32+ assert (0.0 - (0.0 - 2.0) == 2.0) "0.0 - (0.0 - 2.0) == 2.0"
33+ assert (0.0 - (0.0 + 2.0) == -2.0) "0.0 - (0.0 + 2.0) == -2.0"
3434
35− assert (6 / (3 * 2) == 1) "6 / (3 * 2) == 1"
36− assert ((6 / 3) * 2 == 4) "(6 / 3) * 2 == 4"
35+ assert (6.0 / (3.0 * 2.0) == 1.0) "6.0 / (3.0 * 2.0) == 1.0"
36+ assert ((6.0 / 3.0) * 2.0 == 4.0) "(6.0 / 3.0) * 2.0 == 4.0"
3737
38− assert (not (1 < 0) == true) "not (1 < 0) == true"
39− assert (not ((negate 1) < 0) == false) "not ((negate 1) < 0) == false"
38+ assert (not (1.0 < 0.0) == true) "not (1.0 < 0.0) == true"
39+ assert (not ((negate 1.0) < 0.0) == false) "not ((negate 1.0) < 0.0) == false"
4040
41− assert (negate (1 + 10) == -11) "negate (1 + 10) == -11"
41+ assert (negate (1.0 + 10.0) == -11.0) "negate (1.0 + 10.0) == -11.0"
4242
43− assert (2 * 3 / 4 == 1.5) "2 * 3 / 4 == 1.5"
44− assert (1 * 2 * 3 * 4 * 5 / 6 == 20) "1 * 2 * 3 * 4 * 5 / 6 == 20"
43+ assert (2.0 * 3.0 / 4.0 == 1.5) "2.0 * 3.0 / 4.0 == 1.5"
44+ assert (1.0 * 2.0 * 3.0 * 4.0 * 5.0 / 6.0 == 20.0) "1.0 * 2.0 * 3.0 * 4.0 * 5.0 / 6.0 == 20.0"
4545
46− assert (1 + 10 - 5 == 6) "1 + 10 - 5 == 6"
47− assert (1 + 10 * 5 == 51) "1 + 10 * 5 == 51"
48− assert (10 * 5 - 1 == 49) "10 * 5 - 1 == 49"
46+ assert (1.0 + 10.0 - 5.0 == 6.0) "1.0 + 10.0 - 5.0 == 6.0"
47+ assert (1.0 + 10.0 * 5.0 == 51.0) "1.0 + 10.0 * 5.0 == 51.0"
48+ assert (10.0 * 5.0 - 1.0 == 49.0) "10.0 * 5.0 - 1.0 == 49.0"
4949
5050 trace "Success!"
examples/passing/OperatorInlining.purs+12−12
@@ -5,26 +5,26 @@ import Debug.Trace
55main = do
66
77 -- semiringNumber
8− print (1 + 2)
9− print (1 * 2)
8+ print (1.0 + 2.0)
9+ print (1.0 * 2.0)
1010
1111 -- ringNumber
12− print (1 - 2)
13− print (negate 1)
12+ print (1.0 - 2.0)
13+ print (negate 1.0)
1414
1515 -- moduleSemiringNumber
16− print (1 / 2)
16+ print (1.0 / 2.0)
1717
1818 -- ordNumber
19− print (1 > 2)
20− print (1 < 2)
21− print (1 <= 2)
22− print (1 >= 2)
23− print (1 == 2)
19+ print (1.0 > 2.0)
20+ print (1.0 < 2.0)
21+ print (1.0 <= 2.0)
22+ print (1.0 >= 2.0)
23+ print (1.0 == 2.0)
2424
2525 -- eqNumber
26− print (1 == 2)
27− print (1 /= 2)
26+ print (1.0 == 2.0)
27+ print (1.0 /= 2.0)
2828
2929 -- eqString
3030 print ("foo" == "bar")
examples/passing/OperatorSections.purs+4−4
@@ -14,8 +14,8 @@ foreign import eqeqeq
1414infixl 4 ===
1515
1616main = do
17− Debug.Trace.print $ (/ 2) 4 === 2
18− Debug.Trace.print $ (2 /) 4 === 0.5
19− Debug.Trace.print $ (`const` 1) 2 === 2
20− Debug.Trace.print $ (1 `const`) 2 === 1
17+ Debug.Trace.print $ (/ 2.0) 4.0 === 2.0
18+ Debug.Trace.print $ (2.0 /) 4.0 === 0.5
19+ Debug.Trace.print $ (`const` 1.0) 2.0 === 2.0
20+ Debug.Trace.print $ (1.0 `const`) 2.0 === 1.0
2121 Debug.Trace.trace "Done!"
examples/passing/OptimizerBug.purs+1−1
@@ -2,7 +2,7 @@ module Main where
22
33import Prelude
44
5−x a = 1 + y a
5+x a = 1.0 + y a
66
77y a = x a
88
examples/passing/PartialFunction.purs+3−3
@@ -13,7 +13,7 @@ foreign import testError
1313 """ :: (Unit -> Number) -> String
1414
1515fn :: Number -> Number
16−fn 0 = 0
17−fn 1 = 2
16+fn 0.0 = 0.0
17+fn 1.0 = 2.0
1818
19−main = Debug.Trace.trace (show $ testError $ \_ -> fn 2)
19+main = Debug.Trace.trace (show $ testError $ \_ -> fn 2.0)
examples/passing/Rank2Data.purs+1−1
@@ -10,7 +10,7 @@ module Main where
1010 data Nat = Nat forall r. r -> (r -> r) -> r
1111
1212 runNat = \nat -> case nat of
13− Nat f -> f 0 (\n -> n + 1)
13+ Nat f -> f 0.0 (\n -> n + 1.0)
1414
1515 zero' = Nat (\zero' _ -> zero')
1616
examples/passing/Rank2Object.purs+1−1
@@ -5,6 +5,6 @@ import Debug.Trace
55data Foo = Foo { id :: forall a. a -> a }
66
77foo :: Foo -> Number
8−foo (Foo { id = f }) = f 0
8+foo (Foo { id = f }) = f 0.0
99
1010main = trace "Done"
examples/passing/Rank2TypeSynonym.purs+1−1
@@ -8,7 +8,7 @@ foo :: forall a. a -> Foo a
88foo x = pure x
99
1010bar :: Foo Number
11−bar = foo 3
11+bar = foo 3.0
1212
1313main = do
1414 x <- bar
examples/passing/Rank2Types.purs+1−1
@@ -3,7 +3,7 @@ module Main where
33 import Prelude
44
55 test1 :: (forall a. (a -> a)) -> Number
6− test1 = \f -> f 0
6+ test1 = \f -> f 0.0
77
88 forever :: forall m a b. (forall a b. m a -> (a -> m b) -> m b) -> m a -> m b
99 forever = \bind action -> bind action $ \_ -> forever bind action
examples/passing/Recursion.purs+3−3
@@ -3,8 +3,8 @@ module Main where
33 import Prelude
44
55 fib = \n -> case n of
6− 0 -> 1
7− 1 -> 1
8− n -> fib (n - 1) + fib (n - 2)
6+ 0.0 -> 1.0
7+ 1.0 -> 1.0
8+ n -> fib (n - 1.0) + fib (n - 2.0)
99
1010 main = Debug.Trace.trace "Done"
examples/passing/RowConstructors.purs+5−5
@@ -5,10 +5,10 @@ type Bar = (x :: Number, y :: Number, z :: Number)
55type Baz = { w :: Number | Bar }
66
77foo :: { | Foo }
8−foo = { x: 0, y: 0, z: 0 }
8+foo = { x: 0.0, y: 0.0, z: 0.0 }
99
1010bar :: { | Bar }
11−bar = { x: 0, y: 0, z: 0 }
11+bar = { x: 0.0, y: 0.0, z: 0.0 }
1212
1313id' :: Object Foo -> Object Bar
1414id' = id
@@ -20,16 +20,16 @@ bar' :: { | Bar }
2020bar' = id' bar
2121
2222baz :: Baz
23−baz = { x: 0, y: 0, z: 0, w: 0 }
23+baz = { x: 0.0, y: 0.0, z: 0.0, w: 0.0 }
2424
2525type Quux r = (q :: Number | r)
2626type Norf r = (q' :: Number | Quux r)
2727
2828quux :: { f :: { | Foo } | Quux Bar }
29−quux = { f: foo', x: 0, y: 0, z: 0, q: 0 }
29+quux = { f: foo', x: 0.0, y: 0.0, z: 0.0, q: 0.0 }
3030
3131quux' :: { | Norf Bar }
32−quux' = { x: 0, y: 0, z: 0, q: 0, q': 0 }
32+quux' = { x: 0.0, y: 0.0, z: 0.0, q: 0.0, q': 0.0 }
3333
3434wildcard :: { w :: Number | _ } -> Baz
3535wildcard { w: w } = { x: w, y: w, z: w, w: w }
examples/passing/RowSynonyms.purs+1−1
@@ -35,7 +35,7 @@ withIt :: forall bindings eff a. Shadow (Object bindings) ->
3535 ({addition :: Number | bindings} -> Eff eff a) -> Eff eff a
3636withIt (Shadow str) success = do
3737 b <- withBindings
38− success (b{addition = 1})
38+ success (b{addition = 1.0})
3939
4040foreign import withBindings
4141"""
examples/passing/RuntimeScopeIssue.purs+5−5
@@ -9,11 +9,11 @@ class B a where
99 b :: a -> Boolean
1010
1111instance aNumber :: A Number where
12− a 0 = true
13− a n = b (n - 1)
12+ a 0.0 = true
13+ a n = b (n - 1.0)
1414
1515instance bNumber :: B Number where
16− b 0 = false
17− b n = a (n - 1)
16+ b 0.0 = false
17+ b n = a (n - 1.0)
1818
19−main = Debug.Trace.print $ a 10
19+main = Debug.Trace.print $ a 10.0
examples/passing/ScopedTypeVariables.purs+1−1
@@ -16,7 +16,7 @@ test2 = h
1616 g y = f (f y)
1717
1818test3 :: Number
19−test3 = ((\b -> b :: b) :: forall b. b -> b) 0
19+test3 = ((\b -> b :: b) :: forall b. b -> b) 0.0
2020
2121test4 :: forall a. (a -> a) -> a -> a
2222test4 = h
examples/passing/ShadowedRename.purs+3−3
@@ -7,15 +7,15 @@ foreign import f
77 """
88 function f(x) {
99 return function() {
10− if (x !== 2) throw new Error('x is not 2');
10+ if (x !== 2.0) throw new Error('x is not 2.0');
1111 };
1212 }
1313 """ :: forall e. Number -> Eff e Number
1414
1515foo foo = let foo_1 = \_ -> foo
16− foo_2 = foo_1 unit + 1
16+ foo_2 = foo_1 unit + 1.0
1717 in foo_2
1818
1919main = do
20− f (foo 1)
20+ f (foo 1.0)
2121 trace "Done"
examples/passing/ShadowedTCO.purs+1−1
@@ -1,6 +1,6 @@
11module Main where
22
3−runNat f = f 0 (\n -> n + 1)
3+runNat f = f 0.0 (\n -> n + 1.0)
44
55zero' z _ = z
66
examples/passing/ShadowedTCOLet.purs+2−2
@@ -1,7 +1,7 @@
11module Main where
22
33f x y z =
4− let f 1 2 3 = 1
4+ let f 1.0 2.0 3.0 = 1.0
55 in f x z y
66
7−main = Debug.Trace.trace $ show $ f 1 3 2
7+main = Debug.Trace.trace $ show $ f 1.0 3.0 2.0
examples/passing/SignedNumericLiterals.purs+4−4
@@ -1,15 +1,15 @@
11module Main where
22
33 p = 0.5
4− q = 1
5− x = -1
4+ q = 1.0
5+ x = -1.0
66 y = -0.5
77 z = 0.5
8− w = 1
8+ w = 1.0
99
1010 f :: Number -> Number
1111 f x = -x
1212
13− test1 = 2 - 1
13+ test1 = 2.0 - 1.0
1414
1515 main = Debug.Trace.trace "Done"
examples/passing/Superclasses1.purs+2−2
@@ -7,7 +7,7 @@ class (Su a) <= Cl a where
77 cl :: a -> a -> a
88
99instance suNumber :: Su Number where
10− su n = n + 1
10+ su n = n + 1.0
1111
1212instance clNumber :: Cl Number where
1313 cl n m = n + m
@@ -15,4 +15,4 @@ instance clNumber :: Cl Number where
1515test :: forall a. (Cl a) => a -> a
1616test a = su (cl a a)
1717
18−main = Debug.Trace.print $ test 10
18+main = Debug.Trace.print $ test 10.0
examples/passing/Superclasses2.purs+2−2
@@ -9,7 +9,7 @@ class (Su [a]) <= Cl a where
99 cl :: a -> a -> a
1010
1111instance suNumber :: Su Number where
12− su n = n + 1
12+ su n = n + 1.0
1313
1414instance suArray :: (Su a) => Su [a] where
1515 su (x : _) = [su x]
@@ -20,4 +20,4 @@ instance clNumber :: Cl Number where
2020test :: forall a. (Cl a) => a -> [a]
2121test x = su [cl x x]
2222
23−main = Debug.Trace.print $ test 10 `unsafeIndex` 0
23+main = Debug.Trace.print $ test 10.0 `unsafeIndex` 0.0
examples/passing/Superclasses3.purs+1−1
@@ -8,7 +8,7 @@ class (Monad m) <= MonadWriter w m where
88 tell :: w -> m Unit
99
1010testFunctor :: forall m. (Monad m) => m Number -> m Number
11−testFunctor n = (+) 1 <$> n
11+testFunctor n = (+) 1.0 <$> n
1212
1313test :: forall w m. (Monad m, MonadWriter w m) => w -> m Unit
1414test w = do
examples/passing/TCOCase.purs+3−3
@@ -2,9 +2,9 @@ module Main where
22
33data Data = One | More Data
44
5−main = Debug.Trace.trace (from (to 10000 One))
5+main = Debug.Trace.trace (from (to 10000.0 One))
66 where
7− to 0 a = a
8− to n a = to (n - 1) (More a)
7+ to 0.0 a = a
8+ to n a = to (n - 1.0) (More a)
99 from One = "Done"
1010 from (More d) = from d
examples/passing/TailCall.purs+2−2
@@ -7,9 +7,9 @@ test n [] = n
77test n (x:xs) = test (n + x) xs
88
99loop :: forall a. Number -> a
10−loop x = loop (x + 1)
10+loop x = loop (x + 1.0)
1111
1212notATailCall = \x ->
1313 (\notATailCall -> notATailCall x) (\x -> x)
1414
15−main = Debug.Trace.print (test 0 [1, 2, 3])
15+main = Debug.Trace.print (test 0.0 [1.0, 2.0, 3.0])
examples/passing/TopLevelCase.purs+4−4
@@ -13,16 +13,16 @@ infixl 7 %
1313(%) = jsMod
1414
1515gcd :: Number -> Number -> Number
16−gcd 0 x = x
17−gcd x 0 = x
16+gcd 0.0 x = x
17+gcd x 0.0 = x
1818gcd x y | x > y = gcd (x % y) y
1919gcd x y = gcd (y % x) x
2020
21−guardsTest (x:xs) | x > 0 = guardsTest xs
21+guardsTest (x:xs) | x > 0.0 = guardsTest xs
2222guardsTest xs = xs
2323
2424data A = A
2525
26−parseTest A 0 = 0
26+parseTest A 0.0 = 0.0
2727
2828main = Debug.Trace.trace "Done"
examples/passing/TypeClasses.purs+4−4
@@ -53,17 +53,17 @@ instance bindMaybe :: Bind Maybe where
5353instance monadMaybe :: Monad Maybe
5454
5555test4 :: forall a m. (Monad m) => a -> m Number
56−test4 = \_ -> return 1
56+test4 = \_ -> return 1.0
5757
58−test5 = \_ -> Just 1 >>= \n -> return (n + 1)
58+test5 = \_ -> Just 1.0 >>= \n -> return (n + 1.0)
5959
6060ask r = r
6161
6262runReader r f = f r
6363
64−test9 _ = runReader 0 $ do
64+test9 _ = runReader 0.0 $ do
6565 n <- ask
66− return $ n + 1
66+ return $ n + 1.0
6767
6868main = Debug.Trace.trace (test7 "Done")
6969
examples/passing/TypeDecl.purs+2−2
@@ -6,7 +6,7 @@ module Main where
66 k x y = x
77
88 iterate :: forall a. Number -> (a -> a) -> a -> a
9− iterate 0 f a = a
10− iterate n f a = iterate (n - 1) f (f a)
9+ iterate 0.0 f a = a
10+ iterate n f a = iterate (n - 1.0) f (f a)
1111
1212 main = Debug.Trace.trace "Done"
examples/passing/TypeWildcards.purs+1−1
@@ -1,7 +1,7 @@
11module Main where
22
33testTopLevel :: _ -> _
4−testTopLevel n = n + 1
4+testTopLevel n = n + 1.0
55
66test :: forall a. (Eq a) => (a -> a) -> a -> a
77test f a = go (f a) a
examples/passing/UnknownInTypeClassLookup.purs+1−1
@@ -9,4 +9,4 @@ test _ _ = "Done"
99
1010runTest a = test a a
1111
12−main = Debug.Trace.trace $ runTest 0
12+main = Debug.Trace.trace $ runTest 0.0
examples/passing/Where.purs+14−14
@@ -7,29 +7,29 @@ import Control.Monad.ST
77test1 x = y
88 where
99 y :: Number
10− y = x + 1
10+ y = x + 1.0
1111
1212test2 x y = x' + y'
1313 where
14− x' = x + 1
15− y' = y + 1
14+ x' = x + 1.0
15+ y' = y + 1.0
1616
1717
18−test3 = f 1 2 3
18+test3 = f 1.0 2.0 3.0
1919 where f x y z = x + y + z
2020
2121
22−test4 = f (+) [1, 2]
22+test4 = f (+) [1.0, 2.0]
2323 where f x [y, z] = x y z
2424
2525
26−test5 = g 10
26+test5 = g 10.0
2727 where
28− f x | x > 0 = g (x / 2) + 1
29− f x = 0
30− g x = f (x - 1) + 1
28+ f x | x > 0.0 = g (x / 2.0) + 1.0
29+ f x = 0.0
30+ g x = f (x - 1.0) + 1.0
3131
32−test6 = if f true then f 1 else f 2
32+test6 = if f true then f 1.0 else f 2.0
3333 where f :: forall a. a -> a
3434 f x = x
3535
@@ -37,13 +37,13 @@ test7 :: Number -> Number
3737test7 x = go x
3838 where
3939 go y | (x - 0.1 < y * y) && (y * y < x + 0.1) = y
40− go y = go $ (y + x / y) / 2
40+ go y = go $ (y + x / y) / 2.0
4141
4242main = do
43− Debug.Trace.print (test1 1)
44− Debug.Trace.print (test2 1 2)
43+ Debug.Trace.print (test1 1.0)
44+ Debug.Trace.print (test2 1.0 2.0)
4545 Debug.Trace.print test3
4646 Debug.Trace.print test4
4747 Debug.Trace.print test5
4848 Debug.Trace.print test6
49− Debug.Trace.print (test7 100)
49+ Debug.Trace.print (test7 100.0)