Skip to content

Instantly share code, notes, and snippets.

@kuribas
Created September 30, 2020 08:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuribas/8afd49cf87fe5b1c32b1009ab59c4b1d to your computer and use it in GitHub Desktop.
Save kuribas/8afd49cf87fe5b1c32b1009ab59c4b1d to your computer and use it in GitHub Desktop.
data PartialUser = PartialUser
{ lastName :: Maybe String
, firstName :: Maybe String
, email :: Maybe String
}
userWizzardNext :: PartialUser -> Form PartialUser
userWizzardNext user
| isNothing (lastName user) = fetchLastName user
| isNothing (firstName user) = fetchFirstName user
| isNothing (email user) = fetchEmail user
| otherwise = pure user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment