Skip to content

Instantly share code, notes, and snippets.

@andreas

andreas/foo.ml Secret

Created November 26, 2017 19:09
Show Gist options
  • Save andreas/ee2fc584996ec7b10e9baab4eb513d53 to your computer and use it in GitHub Desktop.
Save andreas/ee2fc584996ec7b10e9baab4eb513d53 to your computer and use it in GitHub Desktop.
type 'a foo = Foo : {
f : 'a -> int;
mutable x : string;
} -> 'a foo
let some_foo : 'a. 'a foo = Foo {
f = (fun _ -> 1);
x = "";
}
(*
File "foo.ml", line 6, characters 28-65:
Error: This definition has type 'a foo which is less general than
'a0. 'a0 foo
*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment