Created
March 19, 2021 07:52
-
-
Save Octachron/916d307c4a4ea031e3b795b0cc0a361e to your computer and use it in GitHub Desktop.
How to temporarily hide a type
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
type _ foo = F1: int foo | F2: boo foo | |
type 'b any = Any: 'a foo * ('a,'b) eq -> 'b any | |
let split x = Any(x,Refl) | |
let g (type tmp) (): int = | |
let Any (type t) (foo,secret: t foo * (t,_) eq ) = split F1 in | |
let tmp: t = match foo with F1 -> 0 | F2 -> true in | |
match secret with Refl -> tmp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment