author: michael pilquist

Functional Programming in Scala, Second Edition

... What happens when we use Task with Stream ? We can use eval just like we did with 10 : val s : Stream [ Task , Int ] = Stream.eval ( Task ( " asdf " .toInt ) ) When we convert this stream to a task via one of the stream eliminators ...

Functional Programming in Scala, Second Edition

... def take ( n : Int ) : Pull [ 0 , Option [ R ] ] if n < = 0 then Result ( None ) else step match = case Left ( r ) = > Result ( Some ( r ) ) case Right ( ( hd , tl ) ) = > Output ( hd ) >> tl.take ( n - 1 ) We can build lots of ...

This website uses cookies and collects data for optimal performance. Your continued use signifies agreement to our Privacy Policy.