:: List a = Nil | Cons a (List a); :: Tuple a b = Tuple a b; :: Either a b = Left a | Right b; :: Maybe a = Nothing | Just a; :: St s a = St (s -> Tuple a s); //Function application $ ifxr 0 x y = x y; //Reverse function application & ifxr 0 x y = y x; //Flip flip f x y = f y x; //Composition .. ifxr 9 f g x = f (g x); //Arithmetic operators == ifxl 7 = code eq; * ifxl 7 = code mul; - ifxl 6 = code sub; + ifxl 6 = code add; //fst = code fst; //snd = code snd; on f g a b = f (g a) (g b); //Conditional operators if = code if; fac i = if (i == 0) 1 $ i * fac (i - 1); id x = x; even i = if (i == 0) True (odd (i - 1)); odd i = if (i == 0) False (even (i - 1)); //uncurry f t = f (fst t) (snd t); return a = St $ Tuple a; //>>= ifxr 0 ma atmb = \s. uncurry atmb (ma s); start = St;