Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jfairbank/elm-stream
Fast and simple stream library for Elm
https://github.com/jfairbank/elm-stream
elm lazy stream
Last synced: about 2 months ago
JSON representation
Fast and simple stream library for Elm
- Host: GitHub
- URL: https://github.com/jfairbank/elm-stream
- Owner: jfairbank
- License: mit
- Created: 2017-12-02T02:25:31.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-06T02:29:01.000Z (about 7 years ago)
- Last Synced: 2024-04-15T00:19:30.169Z (9 months ago)
- Topics: elm, lazy, stream
- Language: Elm
- Homepage: http://package.elm-lang.org/packages/jfairbank/elm-stream/latest
- Size: 25.4 KB
- Stars: 8
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# elm-stream
Fast and simple stream library for Elm. Create streams of data or flatten multiple operations over lists.
Streams flatten operations like `map` and `filter` so you don't have to iterate through a stream multiple times like a list.
```elm
import StreamStream.range 1 1000
|> Stream.map (\n -> n * 2)
|> Stream.filter (\n -> n > 10)
|> Stream.take 3
|> Stream.toList == [12, 14, 16]
```You can use streams with lists of data too.
```elm
[1, 2, 3, 4, 5]
|> Stream.fromList
|> Stream.map (\n -> 2 ^ n)
|> Stream.filter (\n -> n > 8)
|> Stream.toList == [16, 32]
```