Skip to content

Instantly share code, notes, and snippets.

@eterps
Created Apr 19, 2019
Embed
What would you like to do?
ReasonML equality
type customerId =
| CustomerId(int);
type orderId =
| OrderId(int);
let cid = CustomerId(42);
let oid = OrderId(42);
cid == oid;
/* Refuses to compile with this message: */
/* This has type: orderId But somewhere wanted: customerId */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment