Created
February 17, 2013 20:05
-
-
Save GregRos/4973144 to your computer and use it in GitHub Desktop.
This file contains 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
(* While you can give primitive types aliases, like this:*) | |
type Count = int | |
(* There will never be any type checking involved when assigning from int to Count. *) | |
(* An interesting use of units of measure changes this. If I define: *) | |
[<Measure>] type quantity | |
(* I can then write: *) | |
type Count = int<quantity> | |
(* And now assigning between Count and int will be type checked. *) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment