Skip to content

Instantly share code, notes, and snippets.

@LucianU

LucianU/syntaxError.hs

Last active Oct 26, 2018
Embed
What would you like to do?
userLogin :: EitherIO LoginError Text
userLogin = do
token <- getToken
userpw <- maybe (liftEither (Left NoSuchUser))
return (Map.lookup token users)
password <- liftIO (
T.putStrLn "Enter your password:" >>
T.getLine
)
if userpw == password then
return token
else
liftEither (Left WrongPassword)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment