Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  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) = churchIncrement (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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement