Skip to content

Instantly share code, notes, and snippets.

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