Linear<T, S> = { state: S, data: T }
type CompletedTxState = ‘commit’ | ‘rollback’
Then eg for db transactions:
const commit = (t: Transaction, dbconn: DBConn): Linear<Transaction, CompletedTxState>
Linear<T, S> = { state: S, data: T }
type CompletedTxState = ‘commit’ | ‘rollback’
Then eg for db transactions:
const commit = (t: Transaction, dbconn: DBConn): Linear<Transaction, CompletedTxState>