项目作者: evolution-gaming

项目描述 :
Stream
高级语言: Scala
项目地址: git://github.com/evolution-gaming/sstream.git
创建时间: 2019-07-22T16:14:38Z
项目社区:https://github.com/evolution-gaming/sstream

开源协议:MIT License

下载


SStream

Build Status
Coverage Status
Codacy Badge
Version
License: MIT

Use case examples

  1. test("take") {
  2. Stream[Id].many(1, 2, 3).take(1).toList shouldEqual List(1)
  3. }
  4. test("first") {
  5. Stream[Id].single(0).first shouldEqual Some(0)
  6. }
  7. test("repeat") {
  8. Stream.repeat[Id, Int](0).take(3).length shouldEqual 3
  9. }
  10. test("collect") {
  11. Stream[Id].many(1, 2, 3).collect { case x if x >= 2 => x + 1 }.toList shouldEqual List(3, 4)
  12. }
  13. test("zipWithIndex") {
  14. Stream.repeat[Id, Int](0).zipWithIndex.take(3).toList shouldEqual List((0, 0), (0, 1), (0, 2))
  15. }

Setup

  1. addSbtPlugin("com.evolution" % "sbt-artifactory-plugin" % "0.0.2")
  2. libraryDependencies += "com.evolutiongaming" %% "sstream" % "0.2.1"