Last active
July 1, 2024 12:44
-
-
Save espio999/5732fb65b32a2e241b21e7c830470c46 to your computer and use it in GitHub Desktop.
F# pattern matching - identifier pattern for understanding - 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 TypeMoney = CaseMoney of decimal | |
let calcTax (CaseMoney price) = CaseMoney (price * 0.1m) | |
let p = CaseMoney 100m | |
calcTax p |> printfn "%A" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment