Created
November 3, 2018 14:15
-
-
Save fghibellini/230d416286d8f0b788cacb4e6959847b to your computer and use it in GitHub Desktop.
Servant + postgresql-simple transactions (Handler vs. IO problem)
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
handler1 :: String -> Handler c | |
handler1 emailToken = liftIO $ withTransaction conn $ do | |
res1 <- findEmailTokenInDB emailToken :: IO a | |
if !foundToken(res1) | |
then (throwError $ err401) -- not an IO operation | |
else (do | |
deleteToken emailToken :: IO b | |
authenticateUser :: IO c | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment