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
sealed trait Interact[A] | |
case class Ask(prompt: String) | |
extends Interact[String] | |
case class Tell(msg: String) | |
extends Interact[Unit] | |
trait Monad[M[_]] { | |
def pure[A](a: A): M[A] |
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.Applicative | |
import scalaz.concurrent.Task | |
/** | |
* This `Applicative[Task]` runs tasks in parallel, by defining | |
* `ap` and `apply2` in terms of `mapBoth`. This differs from the | |
* default `Applicative[Task]`, where effects are sequenced | |
* deterministically, in left to right order. | |
*/ | |
val T = new Applicative[Task] { |