the transfer function is almost as ugly as the IO ...
# arrow
s
the transfer function is almost as ugly as the IO version:
Copy code
override fun transfer(
        from: String,
        to: String,
        amount: Amount
    ): Kleisli<F, AccountRepository<F>, Pair<Account, Account>> =
        ReaderT.monad<F, AccountRepository<F>>(this).binding {
            val a = debit(from, amount).bind()
            val b = credit(to, amount).bind()
            Pair(a, b)
        }.fix()
🙈