Package Exports
- type-aligned
- type-aligned/dist/main.js
- type-aligned/dist/module.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 (type-aligned) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Type Aligned
Various abstract data types of type-aligned sequences. A type-aligned sequence is a heterogeneous sequence where the types enforce the element order.
Pipeline
A pipeline is a left-to-right composition of functions.
import { tap, pipe, feed } from "type-aligned";
const length = (s: string) => s.length;
const even = (n: number) => n % 2 === 0;
const pipeline = pipe(length, pipe(even, tap()));
const morphism = feed(pipeline);
console.log(morphism("Hello World!")); // true
console.log(morphism("hello world")); // falseComposition
A composition is a right-to-left composition of functions.
import { id, compose, apply } from "type-aligned";
const length = (s: string) => s.length;
const even = (n: number) => n % 2 === 0;
const composition = compose(even, compose(length, id()));
const morphism = apply(composition);
console.log(morphism("Hello World!")); // true
console.log(morphism("hello world")); // false