Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
let withdrawWithAudit = withdraw |> auditAs "withdraw" Auditing.fileSystem
let depositWithAudit = deposit |> auditAs "deposit" Auditing.fileSystem
while true do
let action =
printfn "Current balance is £%M" account.Balance
Console.Write "(d)eposit, (w)ithdraw or e(x)it: "
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