parro-it / gravity-func

functional utility for gravity
MIT License
7 stars 1 forks source link
example functional gravity

gravity-func

functional utility for gravity

Motivation and future directions.

I started this just to learn gravity, and I published it on github in the hope it can serve as a learning tool for the community.

It' my intention to implement, apart from the exiting map and filter function, the following ones:

Installation

1) Make sure you have installed and compiled gravity:

    git clone https://github.com/marcobambini/gravity.git
    cd gravity
    make

2) Clone this repo under your project directory:

    git clone https://github.com/parro-it/gravity-func.git packages/gravity-func

You can #include this package using #include in your project source code:

    #include 'packages/gravity-func.gravity'

API

func map(fn, data)

The map() method creates a new array with the results of calling a provided function on every element in this array.

func filter(fn, data)

The filter() method creates a new array with all elements that pass the test implemented by the provided function.

License

MIT © 2017 Andrea Parodi