simplify 'enum'
This commit is contained in:
parent
366b1ec4e0
commit
aee8d5b5e1
6 changed files with 113 additions and 59 deletions
|
|
@ -4,6 +4,6 @@
|
|||
// Product-types of more fields (called Structs) can be constructed by nesting Product-types.
|
||||
|
||||
// In JS, all products are encoded in the same way:
|
||||
export const newProduct = l => r => ({l, r});
|
||||
export const newProduct = l => r => ({l, r}); // <-- apparently, this object-based encoding is faster than array-based, in both FF and Chrome.
|
||||
export const getLeft = product => product.l;
|
||||
export const getRight = product => product.r;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue