Created
October 19, 2016 18:28
-
-
Save smondet/a7ad324e185278d9cc9bed4781b99a99 to your computer and use it in GitHub Desktop.
Transfer existential types
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 t = | |
| Text: 'a list -> t | |
type u = | |
| Uext: 'a list -> u | |
let f: t -> u = | |
function | |
| Text l -> Uext l | |
let l = | |
function | |
| Uext l -> List.length l | |
let () = | |
Printf.printf "\n\nl: %d\n\n%!" | |
(l (f (Text [1; 2; 3]))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment