3 ms·
Higher RAII, and the Seven Arcane Uses of Linear Types
- omeze 2y agoIf 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>