Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type foo = [ `A | `B ]
- type _ bar =
- | A : [> `A] bar
- | B : [> `B] bar
- (* This function's type is inferred to be [ `A | `B ] bar -> string
- Is it possible for it to be [< `A | `B ] bar -> string ? *)
- let to_string (t : [< `A | `B] bar) =
- match (t : [< `A | `B] bar :> [`A | `B] bar) with
- | A -> "A"
- | B -> "B"
Advertisement
Add Comment
Please, Sign In to add comment