Definitions

  • identity x = x
  • const x y = x
  • compose f g x = f (g x)
  • fix f = f (fix f)
  • true t f = t
  • false t f = f
  • and x y = x y false
  • or x y = x true y
  • not x = x false true
  • succ n s z = s (n s z)
  • pred n s z = n (λg. λh. h (g s)) (λu. z) (λu. u)
  • add m n s z = m s (n s z)
  • mul m n s z = m (n s) z
  • zero? n = n (λx. false) true
  • cons x xs f z = f x (xs f z)
  • nil f z = z
  • foldr f z l = l f z
  • map f = foldr (compose cons f) nil
  • any = foldr or false
  • all = foldr and true
  • iterate f x = cons x (iterate f (f x))
  • repeat x = cons x (repeat x)

Steps