Skip to content

Instantly share code, notes, and snippets.

View asvanberg's full-sized avatar

Andreas Svanberg asvanberg

  • Stockholm, Sweden
View GitHub Profile
import scalaz._, Scalaz._
object ErrorHandlingExample {
type PartNumber = String
sealed trait CpuType
case object Intel extends CpuType
case object Qualcomm extends CpuType
case class PhoneSpec(
@runarorama
runarorama / gist:a8fab38e473fafa0921d
Last active April 13, 2021 22:28
Compositional application architecture with reasonably priced monads
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]