import { Op, Rewrite, ChainRewrites, Flip } from './util'; export type Add = { op: '+'; a: A; b: B }; export type Identity = Rewrite, A>; export type Commutativity = Rewrite, Add>; export interface Assoc0 { type: 'rewrite', left: Add, B>; right: ChainRewrites<[ Commutativity<'0', A>, Identity, Flip>>, Commutativity, '0'>, ], this['left']>; }; /* Assoc: (a + b) + c = a + (b + c) For a = 0, (0 + b) + c = (b + 0) + c -- comm = b + c -- id = (b + c) + 0 -- flip id = 0 + (b + c) -- comm For a = succ(), */