[Haskell] Read and write file on Windows XP.

2005-04-24 Thread Alexandre Weffort Thenorio
I have a small program which simply reads a text file, gets the second line and changes it and writes a clone file with the second line changed. Basically it looks like that: main :: IO() main =do -- Some code here hexFile - catch (readFile int.hex) (\_ - do putStrLn File

Re: [Haskell-cafe] Using catch and errors

2005-04-22 Thread Alexandre Weffort Thenorio
Thanks for the tips. (There's also the obvious syntax error of not quoting the string int.hex, but I suspect you would have caught that one.) In fact it was supposed to be there. Just a typo I guess After the catch, you have another instance of the readFile command you would have just run,

Re: [Haskell] Re: Going nuts

2005-04-21 Thread Alexandre Weffort Thenorio
@haskell.org Sent: Thursday, April 21, 2005 4:51 AM Subject: [Haskell] Re: Going nuts On 2005-04-20 19:04:32 -0700, Alexandre Weffort Thenorio [EMAIL PROTECTED] said: As usual a beginner in Haskell. Trying to write a simple program in haskel shown below [snip] getLeft :: String - String - String

Re: [Haskell-cafe] a newbie's question

2005-04-21 Thread Alexandre Weffort Thenorio
Well I think one of the best tools to programme on for Windows is UltraEdit, it will give you colors and other stuff (provided you get the correct file for it which is out on the net). Emacs also exists for windows and is not bad, but I don't know if that is the best tool (I sure like it but I

[Haskell] Going nuts

2005-04-20 Thread Alexandre Weffort Thenorio
As usual a beginner in Haskell. Trying to write a simple program in haskel shown below main :: IO() main =catch (do hexFile - readFile file putStr What is the key number (0 or 1)?\n keyno - getLine putStr Input key.\n key - getLine newLine - outputLine keyno key (lines(hexFile)) bla

Re: Haskell for non-Haskell's sake

2003-08-30 Thread Alexandre Weffort Thenorio
- Original Message - --- Hal Daume III [EMAIL PROTECTED] wrote: Hi fellow Haskellers, I'm attempting to get a sense of the topology of the Haskell community. Based on the Haskell Communities Activities reports, it seems that the large majority of people use Haskell for

Help with Exceptions on I/O

2003-08-14 Thread Alexandre Weffort Thenorio
I have a program which creates textfiles out of other files. Since theprogram is runned from windows I output some text strings (Like "Filecreated succefully") and I need to stop the program before it quits so thatthe user can read the line outputted to know what went on and then he canpress

Help with Exceptions on I/O

2003-08-14 Thread Alexandre Weffort Thenorio
I have a program which creates textfiles out of other files. Since the program is runned from windows I output some text strings (Like File created succefully) and I need to stop the program before it quits so that the user can read the line outputted to know what went on and then he can press

Help with Exceptions on I/O

2003-08-14 Thread Alexandre Weffort Thenorio
I have a program which creates textfiles out of other files. Since theprogram is runned from windows I output some text strings (Like "Filecreated succefully") and I need to stop the program before it quits so thatthe user can read the line outputted to know what went on and then he canpress

Re: Recursion with do??

2003-03-14 Thread Alexandre Weffort Thenorio
Thanks it works but what exactly does this in before the last statement does?? I have never seen it before and the program gives me the parse error if I don't have it?? Best Regards NooK - Original Message - From: Hal Daume III [EMAIL PROTECTED] To: Alexandre Weffort Thenorio [EMAIL

Re: How to search for a string sequence in a file a rewrite it???

2003-03-13 Thread Alexandre Weffort Thenorio
bkfilled is supposed to be [String] but it says it is a String, any idea why??? Best Regards Alex - Original Message - From: Hal Daume III [EMAIL PROTECTED] To: Alexandre Weffort Thenorio [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, March 13, 2003 1:38 AM Subject: Re: How to search

How to search for a string sequence in a file a rewrite it???

2003-03-12 Thread Alexandre Weffort Thenorio
OK Guys. First I would like to say thanks for all the help given before. As I said I am still learning Haskell. My problem is the following: I have a text file and somewhere in the file there is string (Let's say ). So I need to find this exact string and overwrite with another string (Lets

Re: How to search for a string sequence in a file a rewrite it???

2003-03-12 Thread Alexandre Weffort Thenorio
Message - From: Hal Daume III [EMAIL PROTECTED] To: Alexandre Weffort Thenorio [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, March 13, 2003 1:05 AM Subject: Re: How to search for a string sequence in a file a rewrite it??? This is how I would do it: recurse down the input string

Re: How to force UNIX text files as output instead of DOS text files??

2003-03-03 Thread Alexandre Weffort Thenorio
Thanks a lot m8 but ghc says it can't the module IOExts when I try to compile, any suggestion??? Do I just use normal writeFile method to create the text file then?? Best Regards Alex - Original Message - From: Glynn Clements [EMAIL PROTECTED] To: Alexandre Weffort Thenorio [EMAIL

Re: How to force UNIX text files as output instead of DOS text files??

2003-03-03 Thread Alexandre Weffort Thenorio
PROTECTED] To: Alexandre Weffort Thenorio [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, March 03, 2003 2:02 AM Subject: Re: How to force UNIX text files as output instead of DOS text files?? Alexandre Weffort Thenorio wrote: I am working on a small program which writes a text file but I need

Re: How to force UNIX text files as output instead of DOS text files??

2003-03-03 Thread Alexandre Weffort Thenorio
[EMAIL PROTECTED] To: Alexandre Weffort Thenorio [EMAIL PROTECTED] Sent: Monday, March 03, 2003 7:19 PM Subject: Re: How to force UNIX text files as output instead of DOS text files?? Alexandre Weffort Thenorio [EMAIL PROTECTED] wrote: Hi Great I got it working. Thanks a lot guys. My only

Re: How to catch and error message and how to make it create unix files instead of dos files??

2003-03-02 Thread Alexandre Weffort Thenorio
PROTECTED] To: Alexandre Weffort Thenorio [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Sunday, March 02, 2003 3:11 AM Subject: Re: How to catch and error message and how to make it create unix files instead of dos files?? Look at the functions try catch and bracket. -- Hal Daume III

How to force UNIX text files as output instead of DOS text files??

2003-03-02 Thread Alexandre Weffort Thenorio
I am working on a small program which writes a text file but I need this file to be in UNIX format and as it is a Windows program I am compiling it, the output file tends to be in DSO format. Is there anyway that I can force it to create the file in UNIX format??? Best Regards NooK