1 0
Sign in to rate

Ramda - Functional Library for JavaScript

0.06MB. 0 audio & 0 images. Updated 2019-02-24.


Reflects: Ramda v0.26.1 Blog Post: https://simonwjackson.io/blog/ramda-anki-sudy-deck/ ----- ***From the Ramda website:*** ## Ramda A practical functional library for JavaScript programmers. Build Status npm module dependencies Gitter ## Why Ramda? There are already several excellent libraries with a functional flavor. Typically, they are meant to be general-purpose toolkits, suitable for working in multiple paradigms. Ramda has a more focused goal. We wanted a library designed specifically for a functional programming style, one that makes it easy to create functional pipelines, one that never mutates user data. ## What's Different? The primary distinguishing features of Ramda are: Ramda emphasizes a purer functional style. Immutability and side-effect free functions are at the heart of its design philosophy. This can help you get the job done with simple, elegant code. Ramda functions are automatically curried. This allows you to easily build up new functions from old ones simply by not supplying the final parameters. The parameters to Ramda functions are arranged to make it convenient for currying. The data to be operated on is generally supplied last. The last two points together make it very easy to build functions as sequences of simpler functions, each of which transforms the data and passes it along to the next. Ramda is designed to support this style of coding. ## Philosophy Using Ramda should feel much like just using JavaScript. It is practical, functional JavaScript. We're not introducing lambda expressions in strings, we're not borrowing consed lists, we're not porting over all of the Clojure functions. Our basic data structures are plain JavaScript objects, and our usual collections are JavaScript arrays. We also keep other native features of JavaScript, such as functions as objects with properties. Functional programming is in good part about immutable objects and side-effect free functions. While Ramda does not enforce this, it enables such style to be as frictionless as possible. We aim for an implementation both clean and elegant, but the API is king. We sacrifice a great deal of implementation elegance for even a slightly cleaner API. Last but not least, Ramda strives for performance. A reliable and quick implementation wins over any notions of functional purity.

Sample (from 255 notes)

Cards are customizable! When this deck is imported into the desktop program, cards will appear as the deck author has made them. If you'd like to customize what appears on the front and back of a card, you can do so by clicking the Edit button, and then clicking the Cards button.
Front toPairsIn
Back Converts an object into an array of key, value arrays. The object's own properties and prototype properties are used. Note that the order of the output array is not guaranteed to be consistent across different JS platforms.
Code const F = function() { this.x = 'X'; };F.prototype.y = 'Y';const f = new F();R.toPairsIn(f); //=> [['x','X'], ['y','Y']]
Front length
Back Returns the number of elements in the array by returning list.length.
Code R.length([]); //=> 0R.length([1, 2, 3]); //=> 3
Front min
Back Returns the smaller of its two arguments.
Code R.min(789, 123); //=> 123R.min('a', 'b'); //=> 'a'

After the file is downloaded, double-click on it to open it in the desktop program.

At this time, it is not possible to add shared decks directly to your AnkiWeb account - they need to be added from the desktop then synchronized to AnkiWeb.


on 1552225670
Thank you for effort!
Comment from author
Of course!