Package Exports
- fuzion
- fuzion/dist/bundle.cjs.js
- fuzion/dist/bundle.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fuzion) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Fuzion
Runtime implementation of shortcut fusion for JavaScript and TypeScript.
Definition (haskell docs)
Shortcut fusion is an optimizer method that merges some function calls into one. E.g., map f * map g
can be substituted by map (f * g)
, and filter p * filter q
can be substituted by filter (\x -> q x && p x)
. It can also help to remove intermediate data structures. E.g., computing sum [1..n]
does not require an explicit list structure, and the expression is actually translated into a simple loop.
API
So far, it supports the following operators:
- fuzion - performs left-to-right function composition. In some libraries this function is named
pipe
,sequence
. - map - applies another function to a list of elements and returns a new result on every element in the calling array.
- filter - invokes a provided predicate function for each array element and includes it into the result.
- forEach - executes a provided function once for each array element.
- take - cuts the length of the produced result. It helps to save operators calls to other operators on array elements that will not be included in the final result.