@@ -8,7 +8,7 @@ module Prelude where
9 on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
9 on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
10 on f g x y = g x `f` g y
10 on f g x y = g x `f` g y
12 asTypeOf :: forall a. a -> a -> a
12 asTypeOf :: forall a. a -> a -> a
13 asTypeOf x _ = x
13 asTypeOf x _ = x
@@ -59,7 +59,7 @@ module Prelude where
60 infixl 4 <*>
60 infixl 4 <*>
62− class Applicative f where
62+ class (Functor f) <= Applicative f where
63 pure :: forall a. a -> f a
63 pure :: forall a. a -> f a
64 (<*>) :: forall a b. f (a -> b) -> f a -> f b
64 (<*>) :: forall a b. f (a -> b) -> f a -> f b
@@ -74,7 +74,7 @@ module Prelude where
75 infixl 1 >>=
75 infixl 1 >>=
77− class Monad m where
77+ class (Applicative m) <= Monad m where
78 return :: forall a. a -> m a
78 return :: forall a. a -> m a
79 (>>=) :: forall a b. m a -> (a -> m b) -> m b
79 (>>=) :: forall a b. m a -> (a -> m b) -> m b
@@ -192,7 +192,7 @@ module Prelude where
192 show GT = "GT"
192 show GT = "GT"
193 show EQ = "EQ"
193 show EQ = "EQ"
195− class Ord a where
195+ class (Eq a) <= Ord a where
196 compare :: a -> a -> Ordering
196 compare :: a -> a -> Ordering
198 infixl 4 <
198 infixl 4 <
@@ -334,11 +334,18 @@ module Prelude where
335 infixr 5 ++
335 infixr 5 ++
337+ class Semigroup a where
337− foreign import (++) "function $plus$plus(s1) {\
340+ foreign import concatString
341+ "function concatString(s1) {\
338− \ return function(s2) {\
342+ \ return function(s2) {\
339− \ return s1 + s2;\
343+ \ return s1 + s2;\
341− \}" :: String -> String -> String
345+ \}" :: String -> String -> String
347+ instance semigroupString :: Semigroup String where
343module Data.Eq where
350module Data.Eq where