[Haskell-beginners] Password Program Questions
toad3k at gmail.com
Thu Aug 3 23:39:04 UTC 2017
Remember that haskell is whitespace delimited. You probably intended
putStrLn "Welcome" to line up with pw, in its own do.
if pass == "12345"
On Thu, Aug 3, 2017 at 6:59 PM, Casey Newsome <casey_newsome98 at ymail.com> wrote:
> I am very new to Haskell and I am attempting to make a simple password
> program as my first program. I have ran into a problem and I am not very
> sure on how to fix it. I do not know how to make a second section for the
> passwords. My guessing attempts have failed so I am asking for help.
> Here is my code
> main = do
> putStrLn "Hello, Who are you?"
> name <- getLine --User Input
> putStrLn ("Hey " ++ name ++ ", What's the password?")
> pass <- getLine
> if pass == "12345"
> then putStrLn ("Welcome")
> else do
> putStrLn "That is wrong!"
> pw = do
> putStrLn "What Password do you need?"
> Thanks in advance, Casey :D
> Beginners mailing list
> Beginners at haskell.org
More information about the Beginners