2018-03-29から1日間の記事一覧
case class S(current: Int, next: Int) { def process() = S(next, current + next) } val fib: Stream[State[S, Int]] = Stream.continually(State(s => (s.process(), s.current))) val state: State[S, Stream[Int]] = fib.take(15).sequence println(st…