public
Authored by
Lucas Baudin
gadt wrapped
type _ data =
| TInt : int -> int data
| TBool: bool -> bool data
type edata = { node: 's. 's data }
type file = edata list
let do_stuff : type s. s data -> unit = fun s ->
match s with
| TInt a -> print_int a; print_endline "";
| TBool b -> if b then print_endline "hello world"
let match_f (f: file) =
List.iter (fun e ->
do_stuff e.node ) f
Please register or sign in to comment