Skip to content

Instantly share code, notes, and snippets.

@Algiras
Created February 10, 2020 12:47
Show Gist options
  • Save Algiras/fe14d551df32778e1c76b36ee66cd302 to your computer and use it in GitHub Desktop.
Save Algiras/fe14d551df32778e1c76b36ee66cd302 to your computer and use it in GitHub Desktop.
def newUser(username: String, password: String): IO[User] =
Applicative[IO].map2(
FUUID.randomFUUID[IO].map(tagFUUIDAsUserId),
BCrypt.hashpw[IO](password)
)(User(_, username, _))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment