/gist:8f43b945f96118156706 Secret
Created
July 29, 2014 14:31
-
-
Save Drup/8f43b945f96118156706 to your computer and use it in GitHub Desktop.
This file contains 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
type one = [ `One ] | |
type two = [ `Two ] | |
type +_ t = OneA | OneB | TwoA | TwoB | |
let oneA : [> one ] t = OneA | |
let oneB : [> one ] t = OneB | |
let twoA : [> two ] t = TwoA | |
let twoB : [> two ] t = TwoB | |
let over_ones : [< one] t -> string = function | |
| OneA -> "onea" | |
| OneB -> "oneb" | |
| _ -> assert false | |
let over_twos : [< two ] t -> string = function | |
| TwoA -> "onea" | |
| TwoB -> "oneb" | |
| _ -> assert false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment