Skip to content

Instantly share code, notes, and snippets.

@espio999
Last active July 1, 2024 12:43
Show Gist options
  • Save espio999/849aece5d3b517eb3b22396bff727f99 to your computer and use it in GitHub Desktop.
Save espio999/849aece5d3b517eb3b22396bff727f99 to your computer and use it in GitHub Desktop.
F# pattern matching - identifier pattern for understanding
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