https://github.com/antonmedv/list
Immutable lists in JavaScript without [] and {}
https://github.com/antonmedv/list
functional-programming immutable javascript
Last synced: about 1 month ago
JSON representation
Immutable lists in JavaScript without [] and {}
- Host: GitHub
- URL: https://github.com/antonmedv/list
- Owner: antonmedv
- License: mit
- Created: 2017-07-06T04:26:31.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-22T07:05:29.000Z (over 8 years ago)
- Last Synced: 2025-03-25T12:50:52.546Z (8 months ago)
- Topics: functional-programming, immutable, javascript
- Language: JavaScript
- Homepage:
- Size: 20.5 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @medv/list
[](https://travis-ci.org/antonmedv/list)
Immutable lists in JavaScript without [] and {}
## Install
```bash
npm install @medv/list
```
## Usage
This implementation requires tail calls optimization which for now available only in [Safari](https://kangax.github.io/compat-table/es6/#test-proper_tail_calls_(tail_call_optimisation))
and in [node](http://node.green/#ES2015-optimisation-proper-tail-calls--tail-call-optimisation-) only with `--harmony-tailcalls` flag.
```js
const {list, reverse, print} = require('@medv/list')
const a = list(1, list(2, list(3)))
const b = reverse(a)
print(a) // (1 2 3)
print(b) // (3 2 1)
```
For all available functions and documentation see [index.js](./index.js)
## License
[MIT](./LICENSE)