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

Lists

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 = In

class In {
term: HKT>;
constructor(term: HKT>) {
this.term = term;
};
};

function out(term: Fix) : HKT>

```

## License
MIT