Skip to content

Instantly share code, notes, and snippets.

@escamoteur
Created March 24, 2020 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save escamoteur/d82cbeb031d05fb690252498530db830 to your computer and use it in GitHub Desktop.
Save escamoteur/d82cbeb031d05fb690252498530db830 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