-
-
Save objmagic/5964ed8cdcbd8c18ac16 to your computer and use it in GitHub Desktop.
gadt corner
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
| module Propagation = struct | |
| type _ t = | |
| IntLit : int -> int t | |
| | BoolLit : bool -> bool t | |
| let check : type s. s t -> s = function | |
| | IntLit n -> n | |
| | BoolLit b -> b | |
| let check : type s. s t -> s = fun x -> | |
| let r = match x with | |
| | IntLit n -> (n : s ) | |
| | BoolLit b -> b | |
| in r | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment