Skip to content

Instantly share code, notes, and snippets.

@espio999
Last active July 1, 2024 12:43
Show Gist options
  • Save espio999/a8c7a8c8f8f880616d524edbb7c09c56 to your computer and use it in GitHub Desktop.
Save espio999/a8c7a8c8f8f880616d524edbb7c09c56 to your computer and use it in GitHub Desktop.
F# pattern matching - identifier pattern for practical purpose
type Money = Money of decimal
let calcTax (price: Money) =
let price = match price with Money p -> p
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