Skip to content
/ libfree Public

LibFree an experiment for using Iterables and :: operator

License

Notifications You must be signed in to change notification settings

dax70/libfree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LibFree is an experiment in Tranducers using Iterables and :: operator

A simple iterator library for JavaScript meant for exploration of Transducers.

Inspired by experimental ES7syntax proposed by Kevin Smith (@zenparsing).

Also heavily influenced by C# Linq

Here is a good explanation on Transducers using JavaScript, though the approach is very different. Understanding Transducers in JavaScript

Installation:

git clone [email protected]:dax70/libfree.git
cd libfree
npm install

Run tests to see API usage and working code.

npm test

There has been a proposal for ES7 (EcmaScript 2016) for function binding syntax for a while.

Here is an example from the proposal and using an iterator library as an example.

/* ES7 */
import { map, takeWhile, forEach } from "iterlib";

getPlayers()
::map(x => x.character())
::takeWhile(x => x.strength > 100)
::forEach(x => console.log(x));

As you may notice, in this case it enables a now common pattern in Javascript thanks to jQuery, namely the Fluent Interface, but more on that later.

Development:

  • Build once: npm run webpack
  • Run dev server: npm start

About

LibFree an experiment for using Iterables and :: operator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published