Created
April 26, 2016 06:41
-
-
Save gsg/ddbfddc5fd9628565bd25242892ab8c6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let refine x : [`B | `C] option = | |
match x with | |
| `A -> None | |
| (`B | `C) as x -> Some x | |
let f (x : [`A | `B]) = | |
match refine x with | |
| None -> assert false | |
| Some x -> x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment