Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.26 KB | None | 0 0
  1. let rec tree_zip t1 t2 =
  2.     match (t1,t2) with
  3.     | (Empty, Empty) -> Empty
  4.     | (_, Empty) -> raise Mismatch
  5.     | (Empty, _) -> raise Mismatch
  6.     | (Node (n1i, n1l), Node (n2i, n2l)) ->
  7.     let f (a,b) = tree_zip a b in
  8.         Node ((n1i, n2i, List.map f(zip n1l n2l)));;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement