simplify 'enum'

This commit is contained in:
Joeri Exelmans 2025-06-03 10:42:36 +02:00
parent 366b1ec4e0
commit aee8d5b5e1
6 changed files with 113 additions and 59 deletions

View file

@ -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;