Last active
July 1, 2024 12:43
-
-
Save espio999/849aece5d3b517eb3b22396bff727f99 to your computer and use it in GitHub Desktop.
F# pattern matching - identifier pattern for understanding
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 (param_price: TypeMoney) = | |
//let local_price = match param_price with CaseMoney local_p -> local_p | |
let local_price = match param_price with CaseMoney (local_p) -> local_p | |
CaseMoney (local_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