Created
November 5, 2017 13:36
-
-
Save deque-blog/d32977edcf4100a448260ff582cf6161 to your computer and use it in GitHub Desktop.
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
REPL> password 3 (== "password") | |
WriteLine "Password:" | |
(ReadLine (\x => | |
if intToBool (prim__eqString x "password") | |
then WriteLine "Successful login after 1 attempt(s)." (Pure True) | |
else WriteLine "Login failed: 1 attempt(s)." | |
(WriteLine "Password:" | |
(ReadLine (\x => | |
if intToBool (prim__eqString x "password") | |
then WriteLine "Successful login after 2 attempt(s)." (Pure True) | |
else WriteLine "Login failed: 2 attempt(s)." | |
(WriteLine "Password:" | |
(ReadLine (\x => | |
if intToBool (prim__eqString x | |
"password") | |
then WriteLine "Successful login after 3 attempt(s)." | |
(Pure True) | |
else WriteLine "Login failed: 3 attempt(s)." | |
(Pure False))))))))) : IOSpec Bool |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment