Description
Recursion schemes over indexed Functors.
Description
Please see the README on GitHub at https://github.com/Skyb0rg007/recursion-schemes-ix#readme
README.md
recursion-schemes-ix
Recursion schemes over indexed datatypes
Heavily inspired by multirec, this library uses PolyKinds and SingI constraints to achieve the same dependent typing as multirec.
This library defines the IFunctor typeclass and recursion-schemes on IFunctors.
Goals:
- Minimal dependencies
- This library depends only on
singlethongs, which in turn only depends ontemplate-haskell. As a result, it should be easy to include in any project
- This library depends only on
- GHCJS compatibility
- This package is used in a compiler that I want to be able to run in the browser
- Ease of use
- Once everything is set-up, writing a recursion-scheme should not be overly complex (looking at you,
mulrirec)
- Once everything is set-up, writing a recursion-scheme should not be overly complex (looking at you,
Non-Goals:
- Eliminating boilerplate
- This library requires hand-written
IShow,IRead,IEq,IOrd,ITraversableinstances. I also recommend writing pattern synonyms to remove theIFixconstructor. Writing these can be a pain, but its only required once for the main data structure, and oneIFunctorinstance whenever you write a dependent recursion-scheme.
- This library requires hand-written
- Speed
- The code in the library mimics the
recurion-schemeslibrary almost directly, simply lifting everything up from*tok -> *. In a future release,INLINEpragmas will be added and possibly benchmarked.
- The code in the library mimics the
Documentation
Not written, but haddocks on the github user site.