Created
January 23, 2016 16:33
-
-
Save AphonicChaos/a4a37559c32ca7ace8ee to your computer and use it in GitHub Desktop.
This file contains hidden or 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
data Form = Form | |
{ username :: String | |
, password :: String | |
, gravatar :: Image} | |
validate :: Form -> Maybe a | |
oneEach, fileType, minLength :: Validator | |
main = do | |
user <- validate Form <$> minLength 8 username | |
<*> oneEach [character, number, special] password | |
<*> fileType JPEG gravatar | |
case user of | |
(Just u) -> redirect welcomePage | |
Nothing -> redirect loginPage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment