@@ -54,11 +54,11 @@ module Prelude where
54 instance Read Boolean where
54 instance Read Boolean where
55 read "true" = true
55 read "true" = true
56 read _ = false
56 read _ = false
58 foreign import readNumber "function readNumber(n) {\
58 foreign import readNumber "function readNumber(n) {\
59 \ return parseInt(n, 10);\
59 \ return parseInt(n, 10);\
60 \}" :: String -> Number
60 \}" :: String -> Number
62 instance Read Number where
62 instance Read Number where
63 read = readNumber
63 read = readNumber
@@ -369,7 +369,7 @@ module Monoid where
369 instance Monoid String where
369 instance Monoid String where
370 mempty = ""
370 mempty = ""
371 (<>) = (++)
371 (<>) = (++)
373 instance Monoid [a] where
373 instance Monoid [a] where
374 mempty = []
374 mempty = []
375 (<>) = Arrays.concat
375 (<>) = Arrays.concat
@@ -440,11 +440,11 @@ module Maybe where
441 fromMaybe :: forall a. a -> Maybe a -> a
441 fromMaybe :: forall a. a -> Maybe a -> a
442 fromMaybe a = maybe a (Prelude.id :: forall a. a -> a)
442 fromMaybe a = maybe a (Prelude.id :: forall a. a -> a)
444 instance Prelude.Monad Maybe where
444 instance Prelude.Monad Maybe where
445 return = Just
445 return = Just
446 (>>=) m f = maybe Nothing f m
446 (>>=) m f = maybe Nothing f m
448 instance Prelude.Applicative Maybe where
448 instance Prelude.Applicative Maybe where
449 pure = Just
449 pure = Just
450 (<*>) (Just fn) x = fn <$> x
450 (<*>) (Just fn) x = fn <$> x
@@ -453,7 +453,7 @@ module Maybe where
453 instance Prelude.Functor Maybe where
453 instance Prelude.Functor Maybe where
454 (<$>) fn (Just x) = Just (fn x)
454 (<$>) fn (Just x) = Just (fn x)
455 (<$>) _ _ = Nothing
455 (<$>) _ _ = Nothing
457 instance (Show a) => Prelude.Show (Maybe a) where
457 instance (Show a) => Prelude.Show (Maybe a) where
458 show (Just x) = "Just " ++ (show x)
458 show (Just x) = "Just " ++ (show x)
459 show Nothing = "Nothing"
459 show Nothing = "Nothing"
@@ -467,11 +467,11 @@ module Either where
467 either :: forall a b c. (a -> c) -> (b -> c) -> Either a b -> c
467 either :: forall a b c. (a -> c) -> (b -> c) -> Either a b -> c
468 either f _ (Left a) = f a
468 either f _ (Left a) = f a
469 either _ g (Right b) = g b
469 either _ g (Right b) = g b
471 instance Prelude.Monad (Either e) where
471 instance Prelude.Monad (Either e) where
472 return = Right
472 return = Right
473 (>>=) = either (\e _ -> Left e) (\a f -> f a)
473 (>>=) = either (\e _ -> Left e) (\a f -> f a)
475 instance Prelude.Applicative (Either e) where
475 instance Prelude.Applicative (Either e) where
476 pure = Right
476 pure = Right
477 (<*>) (Left e) _ = Left e
477 (<*>) (Left e) _ = Left e
@@ -480,7 +480,7 @@ module Either where
480 instance Prelude.Functor (Either a) where
480 instance Prelude.Functor (Either a) where
481 (<$>) _ (Left x) = Left x
481 (<$>) _ (Left x) = Left x
482 (<$>) f (Right y) = Right (f y)
482 (<$>) f (Right y) = Right (f y)
484 instance (Show a, Show b) => Prelude.Show (Either a b) where
484 instance (Show a, Show b) => Prelude.Show (Either a b) where
485 show (Left x) = "Left " ++ (show x)
485 show (Left x) = "Left " ++ (show x)
486 show (Right y) = "Right " ++ (show y)
486 show (Right y) = "Right " ++ (show y)
@@ -632,10 +632,10 @@ module Arrays where
632 instance (Prelude.Show a) => Prelude.Show [a] where
632 instance (Prelude.Show a) => Prelude.Show [a] where
633 show [] = "[]"
633 show [] = "[]"
634 show (x:xs) = show x ++ " : " ++ show xs
634 show (x:xs) = show x ++ " : " ++ show xs
636 instance Prelude.Functor [] where
636 instance Prelude.Functor [] where
637 (<$>) = map
637 (<$>) = map
639 instance Prelude.Monad [] where
639 instance Prelude.Monad [] where
640 return = singleton
640 return = singleton
641 (>>=) = concatMap
641 (>>=) = concatMap
@@ -893,7 +893,7 @@ module Math where
893 foreign import tan "function tan(n){\
893 foreign import tan "function tan(n){\
894 \ return Math.tan(n);\
894 \ return Math.tan(n);\
895 \}" :: Number -> Number
895 \}" :: Number -> Number
897 foreign import e "var e = Math.E;" :: Number
897 foreign import e "var e = Math.E;" :: Number
898 foreign import ln2 "var ln2 = Math.LN2;" :: Number
898 foreign import ln2 "var ln2 = Math.LN2;" :: Number
899 foreign import ln10 "var ln10 = Math.LN10;" :: Number
899 foreign import ln10 "var ln10 = Math.LN10;" :: Number
@@ -947,7 +947,7 @@ module Eff where
947 \ return {};\
947 \ return {};\
950− \}" :: forall e. Eff e Boolean -> Eff e {} -> Eff e {}
950+ \}" :: forall e a. Eff e Boolean -> Eff e a -> Eff e {}
952 foreign import forE "function forE(lo) {\
952 foreign import forE "function forE(lo) {\
953 \ return function(hi) {\
953 \ return function(hi) {\
@@ -1088,18 +1088,18 @@ module ST where
1088 foreign import modifySTRef "function modifySTRef(ref) {\
1088 foreign import modifySTRef "function modifySTRef(ref) {\
1089 \ return function(f) {\
1089 \ return function(f) {\
1090 \ return function() {\
1090 \ return function() {\
1091− \ ref.value = f(ref.value);\
1091+ \ return ref.value = f(ref.value);\
1094− \}" :: forall a h r. STRef h a -> (a -> a) -> Eff (st :: ST h | r) {}
1094+ \}" :: forall a h r. STRef h a -> (a -> a) -> Eff (st :: ST h | r) a
1096 foreign import writeSTRef "function writeSTRef(ref) {\
1096 foreign import writeSTRef "function writeSTRef(ref) {\
1097 \ return function(a) {\
1097 \ return function(a) {\
1098 \ return function() {\
1098 \ return function() {\
1099− \ ref.value = a;\
1099+ \ return ref.value = a;\
1102− \}" :: forall a h r. STRef h a -> a -> Eff (st :: ST h | r) {}
1102+ \}" :: forall a h r. STRef h a -> a -> Eff (st :: ST h | r) a
1104 foreign import runST "function runST(f) {\
1104 foreign import runST "function runST(f) {\
1105 \ return f;\
1105 \ return f;\