Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let (|Cons|Nil|) l =
- if nonempty l then Cons(hd l,tl l)
- else Nil
- let rec pairSum xs =
- match xs with
- | Cons(x, Cons(y,ys)) ->
- consl (x+y) (lazy (pairSum ys))
- | Cons(x, Nil()) ->
- consl x (lazy nil)
- | Nil() ->
- nil
Advertisement
Add Comment
Please, Sign In to add comment