Advertisement
loulett

FuncProgTask1

Mar 2nd, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.22 KB | None | 0 0
  1. //Task 2
  2. let f = (S (*) ((+)2)) >> ((+)1)
  3. //Task 3
  4. let rec fib =
  5.     let rec fib' acc1 acc2 = function
  6.        |1 -> acc1
  7.        |n -> fib' acc2 (acc1 + acc2) (n-1)
  8.     fib' 1 1
  9. //Task4
  10. let carry f = fun x y -> f(x, y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement