Created
January 4, 2019 20:09
-
-
Save mattroberts297/7dc264a54f23bbeed45f1b27880c9f62 to your computer and use it in GitHub Desktop.
SignupModel.scala
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
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