v0.35.0 is there.
This is mostly a polish/small bug fix release. Also, monadic pipes are landed.
Was:
## Move amount from available balance into hold
fn reserve(ledger: Ledger, id: Int, amount: Exchange.Money.Money) -> Result(Ledger, String) =
match find_account(ledger.accounts, id)
Error(e) -> ledger_error(e)
Ok(account) ->
match Exchange.Money.subtract(account.balance, amount)
Error(e) -> ledger_error(e)
Ok(new_balance) ->
match Exchange.Money.add(account.held, amount)
Error(e) -> ledger_error(e)
Ok(new_held) ->
ledger_ok(update_account(ledger, Account{account | balance: new_balance, held: new_held}))
Now:
## Move amount from available balance into hold
fn reserve(ledger: Ledger, id: Int, amount: Exchange.Money.Money) -> Result(Ledger, String) =
find_account(ledger.accounts, id)
|account|> Exchange.Money.subtract(account.balance, amount)
|new_balance|> Exchange.Money.add(account.held, amount)
|new_held|> update_account(ledger, Account{account | balance: new_balance, held: new_held})