Since I have very few Haskell experience I'm really having a hard time to wrap my head around Snap. As an introductory I'm trying to make the example that comes with the framework check for user existence. Can someone tell me how to adapt the function below to get me started? This is what I get now. After checking if the username exists how do I continue?
------------------------------------------------------------------------------
-- | Handle new user form submit
handleNewUser :: Handler App (AuthManager App) ()
handleNewUser = method GET handleForm <|> method POST handleFormSubmit
where
handleForm = render "new_user"
handleFormSubmit = do result <- usernameExists "login"
result <- createUser "login" "password" >> redirect "/"
return result