Skip to content

Instantly share code, notes, and snippets.

@eterps
Created April 19, 2019 20:10
Show Gist options
  • Save eterps/22f901e363bf080456e900065a3c8fed to your computer and use it in GitHub Desktop.
Save eterps/22f901e363bf080456e900065a3c8fed to your computer and use it in GitHub Desktop.
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