Created
April 19, 2019 20:10
-
-
Save eterps/22f901e363bf080456e900065a3c8fed to your computer and use it in GitHub Desktop.
ReasonML equality
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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