Fl-Matrix (Fantasy-Land Matrix)
Provides a lightweight wrapper for functional programming with matrices and vectors
Read the Api Docs for more detail.
Status
Probably production ready ... though this is new and the API may change without notice
Examples
WebGL + Sanctuary Demos:
- Rotating 3D Cube - wrapping gl-matrix for model-view-projection changes
- Moving 2D Plane - manual adjusting of translation coordinates
Pure data wrangling:
- Unit tests - covers the different usage of most functions
Install
- via
npm install fl-matrix
- via browser from https://unpkg.com/fl-matrix/dist/fl-matrix.browser-production.js (it is made available via FlMatrix globals in this case)
Development
Library source is here
The dev setup is configured to enable both unit testing and iterative browser-based developing, powered by Fuse-Box
Roadmap
Fantasy-Land compatibility (not officially tested yet)
- <input checked="" disabled="" type="checkbox"> Functor (map)
- <input checked="" disabled="" type="checkbox"> Foldable (reduce)
- <input checked="" disabled="" type="checkbox"> Concat (add)
- <input checked="" disabled="" type="checkbox"> Category (identity)
- <input checked="" disabled="" type="checkbox"> Setoid (equal)
- <input checked="" disabled="" type="checkbox"> Semigroupoid / compose (multiply)
- <input checked="" disabled="" type="checkbox"> Monoid (empty)
Functional utils (not fp-compatible - see API docs)
- <input checked="" disabled="" type="checkbox"> MapElements
- <input checked="" disabled="" type="checkbox"> ReduceElements
- <input checked="" disabled="" type="checkbox"> Transpose
- <input checked="" disabled="" type="checkbox"> Clone
Core lib
- <input checked="" disabled="" type="checkbox"> Overall structure
- <input checked="" disabled="" type="checkbox"> Create empty matrix
- <input checked="" disabled="" type="checkbox"> Create matrix from values
- <input checked="" disabled="" type="checkbox"> Additional creation helpers
- <input checked="" disabled="" type="checkbox"> Helper functions for getting/setting elements
- <input checked="" disabled="" type="checkbox"> Vector abstraction
Sanctuary definitions
- <input disabled="" type="checkbox"> Matrix
- <input disabled="" type="checkbox"> Vector?
Project setup
- <input checked="" disabled="" type="checkbox"> Local dev building / live testing
- <input checked="" disabled="" type="checkbox"> Target npm
- <input checked="" disabled="" type="checkbox"> Target external import
- <input checked="" disabled="" type="checkbox"> Bundle Typescript definitions
- <input checked="" disabled="" type="checkbox"> Write API docs
- <input checked="" disabled="" type="checkbox"> Show webgl demo via basic 2d fiddle
- <input disabled="" type="checkbox"> Rewrite API docs to use type signatures rather than TS declarations
- <input disabled="" type="checkbox"> Official fantasy-land laws tests
- <input disabled="" type="checkbox"> Advanced fiddle to use more levels of compose (maybe camera / 3d)
Extras
- <input disabled="" type="checkbox"> Invert matrix capability (not sure if this is feasible/worthwhile with arbitrary sizes)