{"name":"compose-function","version":"1.4.0","description":"Compose new functions f(g(x))","main":"index.js","scripts":{"test":"sjs -m ./macro test.sjs -o test.js; _mocha --reporter nyan; rm test.js"},"repository":{"type":"git","url":"http://github.com/stoeffel/compose-function"},"keywords":["function","compose","functional"],"author":{"name":"stoeffel"},"license":"MIT","bugs":{"url":"http://github.com/stoeffel/compose-function/issues"},"homepage":"http://github.com/stoeffel/compose-function","devDependencies":{"chickencurry":"^1.0.2","expect.js":"^0.3.1","mocha":"^2.1.0","sweet.js":"^0.7.3"},"dependencies":{"arity-n":"^1.0.2"},"gitHead":"030777da088dbc37dd8eb25660404b03e5a58380","_id":"compose-function@1.4.0","_shasum":"c0b1b8646a5077f9eb2065de16aff15e84e0a360","_from":".","_npmVersion":"2.1.10","_nodeVersion":"0.10.25","_npmUser":{"name":"schtoeffel","email":"schtoeffel@gmail.com"},"maintainers":[{"name":"schtoeffel","email":"schtoeffel@gmail.com"}],"dist":{"shasum":"c0b1b8646a5077f9eb2065de16aff15e84e0a360","tarball":"http://registry-npm.ywwl.com/compose-function/download/compose-function-1.4.0.tgz","integrity":"sha512-ZxkbTfM6SNgXo8jiETUDgbvnu3uGf6qpL5P0fK01wH7rstwrXRXXjvCW+lqUrpf3bDQVacOk+1+rmOZSSMlYZA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHeCUGxpJPROXLJnFRPHR3EVE3HviIUr4kgQqisN1usWAiEAn3yJLAaFWgH20jweQx0DyNDf/OAp9nneDiKRQj9ugmQ="}],"size":3203,"noattachment":false,"key":"/compose-function/-/compose-function-1.4.0.tgz"},"directories":{},"readme":"[![Travis](https://img.shields.io/travis/stoeffel/compose-function.svg?style=flat-square)](https://travis-ci.org/stoeffel/compose-function)\n[![npm](https://img.shields.io/npm/v/compose-function.svg?style=flat-square)](https://www.npmjs.com/package/compose-function)\n[![Dependency Status](https://david-dm.org/stoeffel/compose-function.svg?style=flat-square)](https://david-dm.org/stoeffel/compose-function)\n[![Coveralls](https://img.shields.io/coveralls/stoeffel/compose-function.svg?style=flat-square)](https://coveralls.io/github/stoeffel/compose-function)\n\n\n<h1 align=\"center\">Compose-Function</h1>\n\n<p align=\"center\">\n  <a href=\"#installation\">Installation</a> |\n  <a href=\"#usage\">Usage</a> |\n  <a href=\"#related\">Related</a> |\n  <a href=\"#license\">License</a>\n  <br><br>\n  <img align=\"center\" height=\"300\" src=\"http://33.media.tumblr.com/006dfad04f93ec5b3680ec7cdae3fafa/tumblr_n8kgl18uU41qcung4o1_1280.gif\">\n  <br>\n  <sub>logo by <a href=\"http://justinmezzell.tumblr.com/\">Justin Mezzell</a></sub>\n  <blockquote align=\"center\">Compose a new function from smaller functions `f(g(x))`</blockquote>\n</p>\n\nInstallation\n------------\n\n`npm install compose-function`\n\nUsage\n-----\n\n## Basic usage\n\n```js\nimport compose from 'compose-function';\n\nconst composition = compose(sqr, add2); // sqr(add2(x))\n\ncomposition(2) // => 16\n\ncompose(sqr, inc)(2); // => 9\ncompose(inc, sqr)(2); // => 5\n```\n\n\n## with curry\n\n```js\nimport compose from 'compose-function';\nimport { curry, _ } from 'curry-this';\n\n\nconst add = (x, y) => x + y;\n\n// add(6, sqr(add(2, x)))\ncompose(\n  add::curry(6),\n  sqr,\n  add::curry(2),\n);\n\n// map(filter(list, even), sqr)\ncompose(\n  map::curry(_, sqr),\n  filter::curry(_, even),\n)([1,2,3,4,5,6,7,8]) // => [4, 16, 36, 64]\n```\n\n### `::` huh?\n\nIf you’re wondering what the `::` thing means, you’d better read this excellent [overview](https://github.com/jussi-kalliokoski/trine/blob/5b735cbfb6b28ae94bac0446d9ecd5ce51fb149b/README.md#why) by [@jussi-kalliokoski](https://github.com/jussi-kalliokoski) or have a look at the [function bind syntax proposal](https://github.com/zenparsing/es-function-bind).\nOr checkout the [curry-this docs][ct].\n\n\nRelated\n----\n\n* [curry-this][ct]\n\nLicense\n----\n\nMIT © [Christoph Hermann](http://stoeffel.github.io)\n\n[r]: http://ramdajs.com\n[ct]: https://github.com/stoeffel/curry-this\n","publish_time":1421765273982,"_cnpm_publish_time":1421765273982,"dist-tags":{"latest":"3.0.3"}}