Skip to content

Instantly share code, notes, and snippets.

@dungpa
Created September 13, 2012 20:30
Show Gist options
  • Save dungpa/3717385 to your computer and use it in GitHub Desktop.
Save dungpa/3717385 to your computer and use it in GitHub Desktop.
Common mistake
type TickTack = Tick | Tack
let ticker x =
match x with
| Tick -> printfn "Tick"
| Tock -> printfn "Tock"
| Tack -> printfn "Tack"
ticker Tick
ticker Tack
// would output
// Tick
// Tock
// instead of seemingly obvious
// Tick
// Tack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment