This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import async | |
import lazy | |
import chanutils | |
def spawnGenerator(channel is Channel) | |
run with for i = count(from: 2) do channel send(i) | |
end | |
def spawnFilter(in is Channel, prime is Int) | |
val out = Channel new(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scalaz._ | |
import Scalaz._ | |
object monads { | |
def fix[A](f: (=> A) => A): A = f(fix(f)) //> fix: [A](f: => A => A)A | |
type Gen[A] = (=> A) => A | |
def gFib: Gen[Int => Int] = (self) => n => |