Книга: Functional Programming in JavaScript
Назад: Bacon.js
Дальше: Development and production environments

Honorable mentions

There are simply too many libraries out there to do them all justice within the scope of this book. Let's look at a few more libraries for functional programming in JavaScript.

    • Possibly the first library for functional programming in JavaScript, is a library that includes comprehensive higher-order function support as well as lambdas
    • Especially prized for its function, library is a very nice Library for functional programming. It was the first library (that I know of) to implement lazy evaluation, getting the ball rolling for , and other libraries
    • Yes, it is named after the infamous rap group Wu Tang Clan
    • Very similar to the libraries, but much smaller
    • The library supports infinite streams and not much else
    • Absolutely tiny in size
    • As the name might imply, the library was inspired by the library
    • Highly optimized
    • is a support library for functional programming techniques in JavaScript, like Underscore, but with some key differences in how it's implemented.
    • Instead of doing in Underscore, it's just in Sugar. This means that it modifies native JavaScript objects, so there is a small risk of it not playing nicely with other libraries that do the same such as Prototype.
    • Very good documentation, unit tests, analyzers, and more.
    • A new functional library and LINQ (Language Integrated Query) engine for JavaScript that supports most of the same LINQ functions that .NET provides
    • 100% lazy evaluation and supports lambda expressions
    • Very young but documentation is excellent
  • JSLINQ
    • Another functional LINQ engine for JavaScript
    • Much older and more mature than library
    • Another utility library that extends JavaScript's functional methods to more primitives: strings, numbers, objects, collections and arrays
  • Folktale
    • Like the library, Folktale is another new library that implements the Fantasy Land specifications. And like its forefather, Folktale is also a collection of libraries for functional programming in JavaScript. It's very young but could have a bright future.
  • jQuery
    • Surprised to see jQuery mentioned here? Although jQuery is not a tool used to perform functional programming, it nevertheless is functional itself. jQuery might be one of the most widely used libraries that has its roots in functional programming.
    • The jQuery object is actually a monad. jQuery uses the monadic laws to enable method chaining:
      $('#mydiv').fadeIn().css('left': 50).alert('hi!');

A full explanation of this can be found in , Functional and Object-oriented Programming in JavaScript.

  • And some of its methods are higher-order:
    $('li').css('left': function(index){return index*50});
  • As of jQuery 1.8, the parameter implements a functional concept known as Promises.
  • jQuery is an abstraction layer, mainly for the DOM. It's not a framework or a toolkit, just a way to use abstraction to increase code-reuse and reduce ugly code. And isn't that what functional programming is all about?
Назад: Bacon.js
Дальше: Development and production environments

bsn
thank
Vesa Karvonen
I hope you don't mind, but I’d like to point you and your readers to my high-performance optics library for JavaScript that is in production use in multiple projects, has comprehensive support for partial optics and interactive documentation: https://calmm-js.github.io/partial.lenses/ (this takes a moment to load — be patient!)