Created
January 4, 2019 20:13
-
-
Save mattroberts297/0629413290170d6c71435e4ca710f92c to your computer and use it in GitHub Desktop.
SignupCore.scala
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
def signupImpl | |
[F[_], A: IsParseable[F, ?], B: HasCodes] | |
(a: A): Signup[SignupError Or B] = | |
OrT.value { | |
for { | |
r <- parse(a) |> OrT.lift | |
_ <- log(info("Parsed body")) |> OrT.lift | |
s <- salt(512) |> OrT.lift | |
_ <- log(info("Created salt")) |> OrT.lift | |
h <- hash(r.p, s, 10000) |> OrT.lift | |
_ <- log(info("Created hash")) |> OrT.lift | |
u = User(r.e, h, s) | |
_ <- persist(u) |> OrT.lift | |
_ <- logW(info("Persisted user")) |> OrT.lift | |
} yield { HasCodes[B].success } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment