Skip to content

Instantly share code, notes, and snippets.

@kwijibo
Last active February 8, 2016 19:21
Show Gist options
  • Save kwijibo/fa7360c8ded8f91a97ac to your computer and use it in GitHub Desktop.
Save kwijibo/fa7360c8ded8f91a97ac to your computer and use it in GitHub Desktop.
Strawman Ramda docs intro

#Datatypes

##Functions

Curried

When call a function with only some of its arguments, you get back a partially-applied function that only expects the remainding arguments: const add1 = R.add(1) // function add1(){...

Placeholders

Any Ramda function, or function created with R.curry, can be called with R.__ as a placeholder argument. This returns a function which has the other supplied arguments partially-applied

Mutation

Ramda functions never mutate their inputs. [ Functions that only retreive data return references, whereas functions that change data, return altered copies. <-- is this always true?]

##Lists

In Ramda, Lists are Arrays, DOMNodeLists, Arguments lists, and Strings: anything that has a .length property with a numeric value, and numeric properties that correspond to that .length.

##Fantasy-land Algebraic Datatypes https://github.com/fantasyland/fantasy-land A number of Ramda functions support objects that implement Fantasy-land interfaces.

  • map Functor
  • filter Filterable
  • ap Applicative
  • lift, liftN Apply
  • sequence Traversable, Applicative
  • traverse Traversable, Applicative

The documentation examples sometimes use the Just and Nothing Applicatives; an implementation of these can be found in the ramda-fantasy library.

#Other Concepts

##Transducers

##Lenses

@buzzdecafe
Copy link

I think the description of Lists is of the implementation, not the intent. The intent is to approximate something like a list of cons-ed pairs. The simplest way to do this is JS is to use an Array. But that is just an unfortunate fact forced upon us by the language.

@buzzdecafe
Copy link

also ap is Apply and of is Applicative IIRC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment