Guest User

Untitled

a guest
Dec 14th, 2019
91
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. churchIncrement : ((a -> a) -> (a -> a)) -> ((a -> a) -> (a -> a))
  2. churchIncrement n = \f => \x => n f (f x)
  3.  
  4. churchNumeral : Nat -> (a -> a) -> (a -> a)
  5. churchNumeral Z = \f => \x => x
  6. churchNumeral (S k) = myIncrement (churchNumeral k)
  7.  
  8. churchPlus : ((a -> a) -> (a -> a)) -> ((a -> a) -> (a -> a)) -> ((a -> a) -> (a -> a))
  9. churchPlus m n = \f => \x => m f (n f x)
  10.  
  11. churchMultiply : ((a -> a) -> (a -> a)) -> ((a -> a) -> (a -> a)) -> ((a -> a) -> (a -> a))
  12. churchMultiply m n = \f => \x => m (n f) x
  13.  
  14. churchPow : ((a -> a) -> (a -> a)) -> (((a -> a) -> (a -> a)) -> ((a -> a) -> (a -> a))) -> ((a -> a) -> (a -> a))
  15. churchPow m n = \f => \x => (n m) f x
  16.  
  17. c : Nat
  18. c = 4
  19.  
  20. f : Integer -> Integer
RAW Paste Data