Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/josephjunker/static-land-recursion-schemes
Javascript recursion schemes compatible with flow-static-land
https://github.com/josephjunker/static-land-recursion-schemes
Last synced: 3 months ago
JSON representation
Javascript recursion schemes compatible with flow-static-land
- Host: GitHub
- URL: https://github.com/josephjunker/static-land-recursion-schemes
- Owner: josephjunker
- Created: 2017-07-09T03:24:33.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-07T19:27:27.000Z (almost 7 years ago)
- Last Synced: 2024-04-09T06:41:54.936Z (3 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 22
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Lists
- awesome-recursion-schemes - static-land-recursion-schemes - (Implementations / Hylomorphisms in the Wild)
README
static-land-recursion-schemes
==================Recursion schemes library, compatible with flow-static-land.
## Installation
```
npm install static-land-recursion-schemes
```## Overview
This provides a small core set of recursion schemes. Functions for composing schemes are not provided. Documentation is in-process, and will be written as a set of guides [here](https://medium.com/@JosephJnk/recursion-schemes-in-javascript-and-flow-with-static-land-recursision-schemes-97cf10599fb7).## Provided schemes
Exports from "static-land-recursion-schemes/lib/schemes":
```
type Algebra = HKT => A;
function cata(Algebra, Fix, Functor) : A
const catamorphism = cata;type Coalgebra = A => HKT;
function ana(Coalgebra, A, Functor) : Fix
const anamorphism = ana;type RAlgebra = (Fix, HKT) => A;
function para(RAlgebra, Fix, Functor) : A
const paramorphism = para;type RCoalgebra = A => HKT, A>>;
function apo(RCoalgebra, A, Functor) : Fix
const apomorphism = apo;function hylo(Algebra, Coalgebra, A, Functor) : B
const hylomorphism = hylo;function zygo(Algebra, (HKT) => A, Fix, Functor) : A
const zygomorphism = zygo;function gApo(Coalgebra, A => HKT>, A, Functor) : Fix
const generalizedApomorphism = gApo;type NaturalTransformation = (HKT) => HKT;
function prepro(NaturalTransformation, Algebra, Fix, Functor) : A
const prepromorphism = prepro;function postpro(NaturalTransformation, Coalgebra, A, Functor) : Fix
const postpromorphism = postpro;
```Exports from "static-land-recursion-schemes/lib/Fix":
```
type Fix = Inclass In {
term: HKT>;
constructor(term: HKT>) {
this.term = term;
};
};function out(term: Fix) : HKT>
```
## License
MIT