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
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,
@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
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
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
- 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
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
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
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
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
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
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
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
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
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
[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
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
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
18 matches
Mail list logo