Closed samhh closed 1 year ago
The following is quite common, particularly for nullary sums:
Sum.match({ // Or lambdas, similar verbosity. Foo: constant('foo'), Bar: constant('bar'), Baz: constant('baz'), })
We could add match/matchW variants that don't provide access to member values:
match
matchW
Sum.matchConstantButPleaseRenameMe({ Foo: 'foo', Bar: 'bar', Baz: 'baz', })
matchX - "X" like "strict".
matchX
The following is quite common, particularly for nullary sums:
We could add
match
/matchW
variants that don't provide access to member values: