Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. type _ tree =
  2. | Node : 'a tree * 'a tree -> 'a tree
  3. | Leaf : [ `good ] tree
  4. | Taint : [< `good | `bad ] tree -> [ `bad ] tree
  5.  
  6. let rec untaint : 'a. 'a tree -> [ `good ] tree =
  7. fun (type t) (tr : t tree) -> match tr with
  8. | Taint _ -> failwith "Cannot untaint this tree"
  9. | Leaf -> Leaf
  10. | Node (l, r) -> Node (untaint l, untaint r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement