Skip to content

Instantly share code, notes, and snippets.

@espio999
Last active July 1, 2024 12:44
Show Gist options
  • Save espio999/3876c6d73c4097936b5b7fc2dcf8c295 to your computer and use it in GitHub Desktop.
Save espio999/3876c6d73c4097936b5b7fc2dcf8c295 to your computer and use it in GitHub Desktop.
F# pattern matching - identifier pattern for practical purpose - shorter
type Money = Money of decimal
let calcTax (Money price) = Money (price * 0.1m)
let p = Money 100m
calcTax p |> printfn "%A"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment