@@ -11,19 +11,23 @@ nil :: forall a. ArrayBox Z a
11nil = ArrayBox []
11nil = ArrayBox []
13foreign import concat
13foreign import concat
14− "function concat(l1) {\
15+ function concat(l1) {
15− \ return function (l2) {\
16+ return function(l2) {
16− \ return l1.concat(l2);\
17+ return l1.concat(l2);
18− \}" :: forall a. [a] -> [a] -> [a]
20+ """ :: forall a. [a] -> [a] -> [a]
20cons' :: forall a n. a -> ArrayBox n a -> ArrayBox (S n) a
22cons' :: forall a n. a -> ArrayBox n a -> ArrayBox (S n) a
21cons' x (ArrayBox xs) = ArrayBox $ concat [x] xs
23cons' x (ArrayBox xs) = ArrayBox $ concat [x] xs
23foreign import error
25foreign import error
24− "function error(msg) {\
27+ function error(msg) {
25− \ throw msg;\
28+ throw msg;
26− \}" :: forall a. String -> a
30+ """ :: forall a. String -> a
28main = case cons' 1 $ cons' 2 $ cons' 3 nil of
32main = case cons' 1 $ cons' 2 $ cons' 3 nil of
29 ArrayBox [1, 2, 3] -> Debug.Trace.trace "Done"
33 ArrayBox [1, 2, 3] -> Debug.Trace.trace "Done"