Skip to content

Instantly share code, notes, and snippets.

@mattroberts297
Created January 4, 2019 20:09
Show Gist options
  • Save mattroberts297/7dc264a54f23bbeed45f1b27880c9f62 to your computer and use it in GitHub Desktop.
Save mattroberts297/7dc264a54f23bbeed45f1b27880c9f62 to your computer and use it in GitHub Desktop.
SignupModel.scala
case class WriteLog(log: Log)
extends SignupA[LogError Or Success]
case object LogError extends SignupError
type LogError = LogError.type
def log(l: Log):
Signup[LogError Or Success] =
liftS(WriteLog(l))
def logW(l: Log) =
log(l).leftWiden[SignupError]
object Signup {
def pure[A](a: A): Signup[A] = Free.pure[SignupA, A](a)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment