Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

document partial{,Right}, curried{,Right}

  • Loading branch information...
commit c48177b91f8f96ab88f4e2f04d1af7887ebcaf04 1 parent ac4fc33
@substack authored
Showing with 36 additions and 15 deletions.
  1. +36 −15 README.markdown
View
51 README.markdown
@@ -6,35 +6,56 @@ to do currying over arguments while passing `this` through.
Instead you can do:
- var ap = require('ap');
- var z = ap([3], function (x, y) {
- return this.z * (x * 2 + y);
- }).call({ z : 10 }, 4);
- console.log(z);
+``` js
+var ap = require('ap');
+var z = ap([3], function (x, y) {
+ return this.z * (x * 2 + y);
+}).call({ z : 10 }, 4);
+console.log(z);
+```
+
***
- 100
+
+```
+100
+```
methods
=======
-ap(args, fn)
-------------
+``` js
+var ap = require('ap')
+```
+
+## ap(args, fn)
Fill in the arguments `args` at the beginning of `fn`'s arguments list.
-pa(args, fn)
-------------
+## ap.pa(args, fn)
Fill in the arguments `args` at the end of `fn`'s arguments list.
-apa(left, right, fn)
---------------------
+## ap.apa(left, right, fn)
Fill in `left` arguments starting from the beginning of `fn`'s argument list and
`right` arguments starting from the end.
-curry(fn, args[0], args[1], ...)
---------------------------------
+## ap.partial(fn, args...)
-Fill in `fn`'s arguments with `args` from the beginning of `fn`'s arguments
+Fill in `fn`'s arguments with `args...` from the beginning of `fn`'s arguments
list.
+
+## ap.partialRight(fn, args...)
+
+Fill in `fn`'s arguments with `args...` starting from the end of `fn`'s
+arguments list.
+
+## ap.curried(fn, args...)
+
+Curry `fn`, returning a new function with `args...` partially applied from the
+beginning of `fn`'s arguments list.
+
+## ap.curriedRight(fn, args...)
+
+Curry `fn` returning a new function with `args...` partially applied from the
+end of `fn`'s arguments list.
Please sign in to comment.
Something went wrong with that request. Please try again.