Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lovasoa/elm-rolling-list
A circular buffer implementation in Elm.
https://github.com/lovasoa/elm-rolling-list
circular-buffer elm
Last synced: 3 months ago
JSON representation
A circular buffer implementation in Elm.
- Host: GitHub
- URL: https://github.com/lovasoa/elm-rolling-list
- Owner: lovasoa
- License: bsd-3-clause
- Created: 2017-03-06T17:57:37.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-02T08:49:15.000Z (almost 2 years ago)
- Last Synced: 2024-05-01T23:27:11.358Z (9 months ago)
- Topics: circular-buffer, elm
- Language: Elm
- Homepage: https://package.elm-lang.org/packages/lovasoa/elm-rolling-list/latest/
- Size: 457 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lovasoa/elm-rolling-list
## Circular buffer
A *Rolling List* is a list with a finite number of elements that can be inifintely
iterated over.```elm
>>> import RollingList
>>> rl = RollingList.fromList [1,2]
>>> RollingList.current rl
Just 1
>>> rolled = RollingList.roll rl
>>> RollingList.current rolled
Just 2
>>> rolledTwice = RollingList.roll rolled
>>> RollingList.current rolledTwice
Just 1
```## test
Just run `npm install && npm test`