https://github.com/evolution-gaming/sstream
Stream
https://github.com/evolution-gaming/sstream
cats cats-effect scala stream
Last synced: about 1 year ago
JSON representation
Stream
- Host: GitHub
- URL: https://github.com/evolution-gaming/sstream
- Owner: evolution-gaming
- License: mit
- Created: 2019-07-22T16:14:38.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-04-01T15:12:13.000Z (about 1 year ago)
- Last Synced: 2025-04-23T00:16:47.871Z (about 1 year ago)
- Topics: cats, cats-effect, scala, stream
- Language: Scala
- Homepage:
- Size: 149 KB
- Stars: 7
- Watchers: 7
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SStream
[](https://github.com/evolution-gaming/sstream/actions?query=workflow%3ACI)
[](https://coveralls.io/r/evolution-gaming/sstream)
[](https://app.codacy.com/gh/evolution-gaming/sstream/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[](https://evolution.jfrog.io/artifactory/api/search/latestVersion?g=com.evolutiongaming&a=sstream_2.13&repos=public)
[](https://opensource.org/licenses/MIT)
## Use case examples
```scala
test("take") {
Stream[Id].many(1, 2, 3).take(1).toList shouldEqual List(1)
}
test("first") {
Stream[Id].single(0).first shouldEqual Some(0)
}
test("repeat") {
Stream.repeat[Id, Int](0).take(3).length shouldEqual 3
}
test("collect") {
Stream[Id].many(1, 2, 3).collect { case x if x >= 2 => x + 1 }.toList shouldEqual List(3, 4)
}
test("zipWithIndex") {
Stream.repeat[Id, Int](0).zipWithIndex.take(3).toList shouldEqual List((0, 0), (0, 1), (0, 2))
}
```
## Setup
```scala
addSbtPlugin("com.evolution" % "sbt-artifactory-plugin" % "0.0.2")
libraryDependencies += "com.evolutiongaming" %% "sstream" % "1.1.0"
```