Skip to content

Instantly share code, notes, and snippets.

@forki
Forked from escamoteur/currying.fs
Created March 24, 2020 19:19
Show Gist options
  • Save forki/8ab9d367f6fdab91d5b7e33d9a7d4880 to your computer and use it in GitHub Desktop.
Save forki/8ab9d367f6fdab91d5b7e33d9a7d4880 to your computer and use it in GitHub Desktop.
let withdrawWithAudit = withdraw |> auditAs "withdraw" Auditing.fileSystem
let depositWithAudit = deposit |> auditAs "deposit" Auditing.fileSystem
while true do
let action =
Console.WriteLine()
printfn "Current balance is £%M" account.Balance
Console.Write "(d)eposit, (w)ithdraw or e(x)it: "
Console.ReadLine()
if action = "x" then Environment.Exit 0
let amount =
Console.Write "Amount: "
Console.ReadLine() |> Decimal.Parse
// Mutate account value via an expression
account <-
if action = "d" then account |> depositWithAudit amount
elif action = "w" then account |> withdrawWithAudit amount
else account
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment