data Maybe a = Nothing | Just a
data Either e a = Left e | Right a
data [a] = [] | a : [a]
newtype Identity a = Identity a
data Proxy a = Proxy
newtype Reader r a = Reader (r -> a))
newtype State s a = State (s -> (a, s))
newtype Parser a = Parser (String -> [(a,String)])
data IO a = ¯\_(ツ)_/¯
data Maybe a = Nothing | Just a
data Either e a = Left e | Right a
data [a] = [] | a : [a]
newtype Identity a = Identity a
data Proxy a = Proxy
newtype Reader r a = Reader (r -> a))
newtype State s a = State (s -> (a, s))
newtype Parser a = Parser (String -> [(a,String)])
data IO a = ¯\_(ツ)_/¯
-- instances of the Ord typeclass have the ordering operators defined.
-- i.e ==, /= , <= etc
-- Ord a is a context
qsort :: Ord a => [a] => [a]
qsort [] = []
qsort (x:rest) = [v | v <- rest, v <= x] ++ [x] ++ [v | v <- rest, v > x]
Comments