Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Created November 5, 2017 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deque-blog/d32977edcf4100a448260ff582cf6161 to your computer and use it in GitHub Desktop.
Save deque-blog/d32977edcf4100a448260ff582cf6161 to your computer and use it in GitHub Desktop.
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