
Now I understand that it's just a lack of knowledge... Sorry for interrupring... By the way, can you recommend a good manual which I can find on the web? -- Zhbanov Pavel

Zhbanov Pavel wrote:
Now I understand that it's just a lack of knowledge... Sorry for interrupring...
By the way, can you recommend a good manual which I can find on the web?
Tutorial:
http://www.haskell.org/tutorial/
Reference Manual:
http://www.haskell.org/definition/
Further Information:
http://www.haskell.org/bookshelf/
--
Glynn Clements

"pavel" == pavel
writes:
pavel> Now I understand that it's just a lack of knowledge... Sorry pavel> for interrupring... pavel> By the way, can you recommend a good manual which I can find pavel> on the web? The best source would be a good book like Simon Thompsons: "Haskell: The Craft of Functional Programming", published by Addison-Wesley. I/O is described in Chapter 18 on page 383 which makes clear that I/O is not the first thing you should try when learning Haskell. Use an interpreter like ghci first and evaluate expressions in interaction with the interpreter. You can also find a tutorial on the web at: http://www.haskell.org/tutorial/ Cheers -- Christoph Herrmann

My task is to write a parser for some language (TSG). I'm using an UU_Parsing library. I wrote that parser even tested it by using some example provided, but I have problems with using my parser. I wrote a function:
test :: [Char] -> IO () test inp = do res <- parseIO pTSG inp print res
parseIO :: InputState a b => AnaParser a Pair b c -> a b -> IO c is provided by the library, pTSG is my parser and inp is a String that I'm parsing. How can I use that function "test" while using readFile? Is it something like:
test1 file = do inp <- readFile file test inp
Why should I use that "do" thing? What is so "magical" in it? PS: Please, don't say that I'm stupid, I just have problem with understanding IO/Monad part, besides that is just me second week of Haskell... :) PS1: "Haskell: The Craft of Functional Programming" didn't make that part clear to me. That's why I'm writing... -- Pavel Zhbanov

Hi Pavel,
"pavel" == pavel
writes:
pavel> My task is to write a parser for some language (TSG). pavel> ... pavel> Why should I use that "do" thing? What is so "magical" in it? pavel> PS: Please, don't say that I'm stupid, I just have problem pavel> with understanding IO/Monad part, besides that is just me pavel> second week of Haskell... :) I think that your task is not appropriate for a Haskell beginner. You should go to the person who gave you the task and tell him/her that you need much more time to learn Haskell, understand how monads are to be used and, maybe, what type classes are. Otherwise, you cannot guarantee that your program will work the way it is supposed to. Good luck -- Christoph
participants (3)
-
?????? ????? ????? ??????
-
Ch. A. Herrmann
-
Glynn Clements