Last active
July 1, 2024 12:44
-
-
Save espio999/3876c6d73c4097936b5b7fc2dcf8c295 to your computer and use it in GitHub Desktop.
F# pattern matching - identifier pattern for practical purpose - shorter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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