5 ms·
If you have to create new types then why can’t this just be done by existing type systems, eg in Typescript: Linear<T, S> = { state: S, data: T } type Complet
by omeze 2y ago
If you have to create new types then why can’t this just be done by existing type systems, eg in Typescript:
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>