Skip to content

Instantly share code, notes, and snippets.

@gsg
Created April 26, 2016 06:41
Show Gist options
  • Save gsg/ddbfddc5fd9628565bd25242892ab8c6 to your computer and use it in GitHub Desktop.
Save gsg/ddbfddc5fd9628565bd25242892ab8c6 to your computer and use it in GitHub Desktop.
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