reorganize directory and file structure
This commit is contained in:
parent
1d826ea8d4
commit
48390b8556
99 changed files with 1155 additions and 1629 deletions
9
lib/structures/product.js
Normal file
9
lib/structures/product.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// Product-type (also called: pair, tuple)
|
||||
|
||||
// A Product-type always has only two fields, called "left" and "right".
|
||||
// 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 getLeft = product => product.l;
|
||||
export const getRight = product => product.r;
|
||||
Loading…
Add table
Add a link
Reference in a new issue