{"id":27914882,"url":"https://github.com/msvbg/parliament","last_synced_at":"2025-05-06T15:32:41.256Z","repository":{"id":57319219,"uuid":"38333167","full_name":"msvbg/parliament","owner":"msvbg","description":"The funkiest functional JavaScipt library you've never heard of.","archived":false,"fork":false,"pushed_at":"2015-07-11T14:54:18.000Z","size":260,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-26T08:45:03.069Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msvbg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-30T21:06:28.000Z","updated_at":"2016-01-10T03:58:41.000Z","dependencies_parsed_at":"2022-08-26T01:10:11.783Z","dependency_job_id":null,"html_url":"https://github.com/msvbg/parliament","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msvbg%2Fparliament","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msvbg%2Fparliament/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msvbg%2Fparliament/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msvbg%2Fparliament/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msvbg","download_url":"https://codeload.github.com/msvbg/parliament/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252712970,"owners_count":21792401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-06T15:31:41.957Z","updated_at":"2025-05-06T15:32:41.248Z","avatar_url":"https://github.com/msvbg.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![parliament.js](https://github.com/msvbg/parliament/raw/master/parliament.png)\n\n\u003e parliament.js is a functional programming utility belt in the vein of\nUnderscore, Lodash, Ramda and Highland, with first-class\nsupport for immutable data structures.\n\n[![Build status][travis-image]][travis-url]\n\n## Install\n```\nnpm install parliament\n```\n\n## Examples\nOne of the strengths of functional programming is how it takes full advantage of composition. For instance, this is how you would define `flatMap` with parliament.js:\n\n```js\nlet flatMap = seq(map, flatten);\n```\n\nSimilarly, this is how the Underscore function `compact` is implemented:\n\n```js\nlet compact = filter(isTruthy);\n```\n\nThe library works seamlessly with the included immutable data structures,\n`Vector` and `Dict`, mapping to JavaScript's `Array` and `Object` respectively.\n\n```js\nlet vec = Vector.of(1, 2, 3, 4, 5, 6, 7);\nlet f = filter(mod(2));\nlet odd = f(vec);\n\nodd.toArray(); // [1, 3, 5, 7]\nvec.toArray(); // [1, 2, 3, 4, 5, 6, 7]\n```\n\nThere is also experimental support for lazy data structures, by making use of\nES6 generators. `Nat` is an included sequence representing the numbers\n`[0, Infinity)`.\n\n```js\nlet fives = map(multiply(5), take(5, Nat()));\n\nfives.toArray() // [0, 5, 10, 15, 20]\n```\n\n## Why not X instead?\nWhen in doubt, use Lodash :)\n\n## License\nMIT © Martin Svanberg\n\n[travis-image]: https://img.shields.io/travis/msvbg/parliament.svg?style=flat\n[travis-url]: https://travis-ci.org/msvbg/parliament","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsvbg%2Fparliament","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsvbg%2Fparliament","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsvbg%2Fparliament/lists"}