[Haskell-cafe] IO help

2009-05-07 Thread applebiz89
I havent done much IO at all in haskell, only within the function itself. However I want to get the input from the interface for the function and havent done this before. In my main function, I want to ask the user what they would like to do 'become fan' for example, then with their choice

Re: [Haskell-cafe] IO help

2009-05-07 Thread Miguel Mitrofanov
I have a suggestion. Why don't you grab some introductory book on Haskell and learn Haskell syntax a little? applebiz89 wrote on 07.05.2009 13:46: I havent done much IO at all in haskell, only within the function itself. However I want to get the input from the interface for the function and

Re: [Haskell-cafe] IO help

2009-05-07 Thread Bulat Ziganshin
Hello applebiz89, Thursday, May 7, 2009, 1:46:34 PM, you wrote: main :: IO() you may find http://haskell.org/haskellwiki/IO_inside interesting -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe

Re: [Haskell-cafe] IO help

2009-05-07 Thread Adrian Neumann
Have a look at the wikibook: http://en.wikibooks.org/wiki/Haskell/Simple_input_and_output Am 07.05.2009 um 11:46 schrieb applebiz89: I havent done much IO at all in haskell, only within the function itself. However I want to get the input from the interface for the function and havent

[Haskell-cafe] IO Help

2008-05-08 Thread Mark Wallsgrove
Hey, I am studying Haskell as a unit at University. I find the concept and design idea's of Haskell interesting but I am finding my self struggling to understand the relationship between the normal state and IO state of Haskell. This is my situation: I have created 12 functions for a program

Re: [Haskell-cafe] IO Help

2008-05-08 Thread Henning Thielemann
On Thu, 8 May 2008, Mark Wallsgrove wrote: Problem now is reading the data back into the program. When I read the data back into the program it comes as IO [Track]. This is the code I have been using to load the data: loadData :: String - Catalogue loadData fileName = do x - readFile

Re: [Haskell-cafe] IO Help

2008-05-08 Thread Mark Wallsgrove
Thank you very much for your fast response! Ok, that is now changed, but everything else in my program is expecting Catalogue without IO. Is there a way to change IO Catalogue into Catalogue? Henning Thielemann wrote: On Thu, 8 May 2008, Mark Wallsgrove wrote: Problem now is reading the

Re: [Haskell-cafe] IO Help

2008-05-08 Thread Daniel Fischer
Am Donnerstag, 8. Mai 2008 14:59 schrieb Mark Wallsgrove: Thank you very much for your fast response! Ok, that is now changed, but everything else in my program is expecting Catalogue without IO. Is there a way to change IO Catalogue into Catalogue? Not a recommendable way. But there's no

Re: [Haskell-cafe] IO Help

2008-05-08 Thread Henning Thielemann
On Thu, 8 May 2008, Mark Wallsgrove wrote: Thank you very much for your fast response! Ok, that is now changed, but everything else in my program is expecting Catalogue without IO. Is there a way to change IO Catalogue into Catalogue? Yes, but you do not want that. You will go on writing

Re: [Haskell-cafe] IO Help

2008-05-08 Thread Henning Thielemann
On Thu, 8 May 2008, Mark Wallsgrove wrote: Thank you very much for your fast response! Ok, that is now changed, but everything else in my program is expecting Catalogue without IO. Is there a way to change IO Catalogue into Catalogue? Btw. there was a nice article precisely about the issue

Re: [Haskell-cafe] IO Help

2008-05-08 Thread Mark Wallsgrove
Was there? I have been google'ing that problem for ages.. Just one more thing. I have to make a menu system where the user chooses what functionality they want. Because you cannot change a value once it is set I have used recursion so that when something changes it then calls the menu back

Re: [Haskell-cafe] IO Help

2008-05-08 Thread Thomas Davie
On 8 May 2008, at 16:31, Mark Wallsgrove wrote: Was there? I have been google'ing that problem for ages.. Just one more thing. I have to make a menu system where the user chooses what functionality they want. Because you cannot change a value once it is set I have used recursion so that

Re: [Haskell-cafe] IO Help

2008-05-08 Thread Mark Wallsgrove
Thank you all for your help, you have been invaluable Thomas Davie wrote: On 8 May 2008, at 16:31, Mark Wallsgrove wrote: Was there? I have been google'ing that problem for ages.. Just one more thing. I have to make a menu system where the user chooses what functionality they want. Because