Skip to content

Instantly share code, notes, and snippets.

@GregRos
Created February 17, 2013 20:05
Show Gist options
  • Save GregRos/4973144 to your computer and use it in GitHub Desktop.
Save GregRos/4973144 to your computer and use it in GitHub Desktop.
(* 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