Skip to content

Instantly share code, notes, and snippets.

@cemerick
Created September 9, 2019 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cemerick/05a519b88cd479c88c5e2f8d80583071 to your computer and use it in GitHub Desktop.
Save cemerick/05a519b88cd479c88c5e2f8d80583071 to your computer and use it in GitHub Desktop.
type j = [`J of int]
type k = [`K of int]
type jk = [ j | k ]
let compatFun (type a) : a -> (a -> int) =
function | #j -> fun (`J x) -> x
| #k -> fun (`K x) -> x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment