Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: Parsing a file (Roger Mason)
2. Re: Parsing a file (Roger Mason)
----------------------------------------------------------------------
Message: 1
Date: Thu, 27 Jan 2022 08:51:01 -0330
From: Roger Mason <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Parsing a file
Message-ID: <[email protected]>
Content-Type: text/plain
Hello Francesco,
Thanks for your help.
Francesco Ariis <[email protected]> writes:
>
> Simple quiz: do you understand why
>
> main :: IO ()
> main = "prova"
>
That returns a String rather than an "IO something".
> does nor work (nor compile) while
>
> main :: IO ()
> main = putStrLn "prova"
>
> does?
putStrLn returns an "IO something" and so is campatible with the type of
main.
Thank you for the help & encouragement.
Roger
------------------------------
Message: 2
Date: Thu, 27 Jan 2022 08:55:02 -0330
From: Roger Mason <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Parsing a file
Message-ID: <[email protected]>
Content-Type: text/plain
Hello David,
David McBride <[email protected]> writes:
> These two pieces of code are not equivalent.
>
> :{
> input = do
> eqatoms <- readFile "Parsing_File/eqatoms.out"
> return eqatoms
> :}
>
> :{
> main = do
> eqatoms <- readFile "Parsing_File/eqatoms.out"
> Parsec.parse species "test species" eqatoms
> return
> :}
Thank you for the help. Now I understand better the error that I made.
Roger
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 162, Issue 2
*****************************************