@@ -39,6 +39,18 @@ module Prelude where
39 (#) :: forall a b. a -> (a -> b) -> b
39 (#) :: forall a b. a -> (a -> b) -> b
40 (#) x f = f x
40 (#) x f = f x
44+ (:) :: forall a. a -> [a] -> [a]
49+ \ return function (l) {\
50+ \ return [e].concat(l);\
52+ \}" :: forall a. a -> [a] -> [a]
42 class Show a where
54 class Show a where
43 show :: a -> String
55 show :: a -> String
@@ -61,6 +73,20 @@ module Prelude where
61 instance showNumber :: Show Number where
73 instance showNumber :: Show Number where
62 show = showNumberImpl
74 show = showNumberImpl
76+ foreign import showArrayImpl
77+ "function showArrayImpl (f) {\
78+ \ return function (xs) {\
80+ \ for (var i = 0, l = xs.length; i < l; i++) {\
83+ \ return '[' + ss.join(',') + ']';\
85+ \}" :: forall a. (a -> String) -> [a] -> String
87+ instance showArray :: (Show a) => Show [a] where
88+ show = showArrayImpl show
64 infixl 4 <$>
90 infixl 4 <$>
66 class Functor f where
92 class Functor f where
@@ -317,14 +343,6 @@ module Prelude where
317 zshr = numZshr
343 zshr = numZshr
318 complement = numComplement
344 complement = numComplement
322− foreign import (!!) "function $bang$bang(xs) {\
323− \ return function(n) {\
326− \}" :: forall a. [a] -> Number -> a
328 infixr 2 ||
346 infixr 2 ||
329 infixr 3 &&
347 infixr 3 &&
@@ -385,6 +403,15 @@ module Data.Eq where
385 (==) = liftRef refEq
403 (==) = liftRef refEq
386 (/=) = liftRef refIneq
404 (/=) = liftRef refIneq
406+module Prelude.Unsafe where
408+ foreign import unsafeIndex
409+ "function unsafeIndex(xs) {\
410+ \ return function(n) {\
413+ \}" :: forall a. [a] -> Number -> a
388module Control.Monad.Eff where
415module Control.Monad.Eff where
390 foreign import data Eff :: # ! -> * -> *
417 foreign import data Eff :: # ! -> * -> *