Skip to content

Instantly share code, notes, and snippets.

@mastoj
Last active September 30, 2015 13:44
Show Gist options
  • Save mastoj/bf97dc3f4bb94fe8eb21 to your computer and use it in GitHub Desktop.
Save mastoj/bf97dc3f4bb94fe8eb21 to your computer and use it in GitHub Desktop.
WhyNoFancyPrint
module Car
type Make = Make of string
type Color = Color of string
type Year = Year of int
type Car = private {Make: Make; Year: Year; Color: Color}
with
member a.PrintYear() = printfn "%A" a.Year
let print (a:Car) = printfn "%A" a // Car+Car
let print (a:Car) = printfn "%+A" a // Print stuff nicely
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment