Skip to content

Instantly share code, notes, and snippets.

@Gbury
Created November 3, 2020 23:08
Show Gist options
  • Save Gbury/d18e9b00a9c1c1a9b4bc227a655e1546 to your computer and use it in GitHub Desktop.
Save Gbury/d18e9b00a9c1c1a9b4bc227a655e1546 to your computer and use it in GitHub Desktop.
type 'payload head =
| Foo : int head
| Bar : float head
| App : t list head
and t = T : {
mutable head : 'payload head;
mutable payload : 'payload;
} -> t
let set_to_float (T t) =
(* this does not typecheck ofc... *)
t.head <- B;
t.payload <- 1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment