This file contains hidden or 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 scala.util.control.Exception | |
import scalaz._ | |
import scalaz.Free.FreeC | |
import scalaz.Scalaz._ | |
object Kasten { | |
///////////////////////// | |
// The State stuff | |
///////////////////////// |
This file contains hidden or 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 scala.annotation.tailrec | |
object MyIo2 { | |
sealed trait IO[+A] { | |
def flatMap[B](f: A => IO[B]): IO[B] = this match { | |
case FlatMap(x, g) => FlatMap(x, (a: Any) => g(a).flatMap(f)) | |
case x => FlatMap(x, f) | |
} |
This file contains hidden or 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.concurrent.Task | |
import scalaz.stream._ | |
import scalaz.stream.Process._ | |
import scalaz.stream.Process.Emit | |
import scalaz.stream.Tee | |
object MatchTee { | |
def matchTee[I: Ordering]: Tee[I, I, (Option[I], Option[I])] = { | |
val ord = implicitly[Ordering[I]] |
NewerOlder