git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix failing tests
commit942c3a5c325597b0ba28bbc0eb7940d47929e393 authorGary Burgess <gary.burgess@gmail.com> dateFri 11 Apr 2014, 21:00 (13 years ago) parent6ff46e4
4 files changed+8−12
examples/passing/Arrays.purs+2−2 examples/passing/EmptyDataDecls.purs+3−3 examples/passing/Superclasses2.purs+3−1 examples/passing/TypeClasses.purs−6
examples/passing/Arrays.purs+2−2
@@ -1,8 +1,8 @@
11module Main where
22
3−import Prelude
3+import Prelude.Unsafe (unsafeIndex)
44
5−test1 arr = arr !! 0 + arr !! 1 + 1
5+test1 arr = arr `unsafeIndex` 0 + arr `unsafeIndex` 1 + 1
66
77test2 = \arr -> case arr of
88 [x, y] -> x + y
examples/passing/EmptyDataDecls.purs+3−3
@@ -17,14 +17,14 @@ foreign import concat
1717 \ };\
1818 \}" :: forall a. [a] -> [a] -> [a]
1919
20−cons :: forall a n. a -> Array n a -> Array (S n) a
21−cons x (Array xs) = Array $ concat [x] xs
20+cons' :: forall a n. a -> Array n a -> Array (S n) a
21+cons' x (Array xs) = Array $ concat [x] xs
2222
2323foreign import error
2424 "function error(msg) {\
2525 \ throw msg;\
2626 \}" :: forall a. String -> a
2727
28−main = case cons 1 $ cons 2 $ cons 3 nil of
28+main = case cons' 1 $ cons' 2 $ cons' 3 nil of
2929 Array [1, 2, 3] -> Debug.Trace.trace "Done"
3030 _ -> error "Failed"
examples/passing/Superclasses2.purs+3−1
@@ -1,5 +1,7 @@
11module Main where
22
3+import Prelude.Unsafe (unsafeIndex)
4+
35class Su a where
46 su :: a -> a
57
@@ -18,4 +20,4 @@ instance clNumber :: Cl Number where
1820test :: forall a. (Cl a) => a -> [a]
1921test x = su [cl x x]
2022
21−main = Debug.Trace.print $ test 10 !! 0
23+main = Debug.Trace.print $ test 10 `unsafeIndex` 0
examples/passing/TypeClasses.purs−6
@@ -57,12 +57,6 @@ test4 = \_ -> return 1
5757
5858test5 = \_ -> Just 1 >>= \n -> return (n + 1)
5959
60−instance showArray :: (Prelude.Show a) => Prelude.Show [a] where
61− show [] = "[]"
62− show (x:xs) = show x ++ ", " ++ show xs
63−
64−test6 = \_ -> show ["testing"]
65−
6660instance functorFunction :: Functor ((->) r) where
6761 (<$>) = liftM1
6862