How to make Parser explicitly "fail"?

2003-03-01 Thread L BB
Hi, there. I am glad to join Haskell community. :) Here I have a question about Parser: how to make a parser explicitly "fail"? My question arises from the syntax below: ::= ::="define" ::=':' ::=identifier other than ::=()+ ::=a..z|A..Z Now I am thinking of writing a Parser for variable. My t

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

2003-03-01 Thread Hal Daume III
Look at the functions try catch and bracket. -- Hal Daume III | [EMAIL PROTECTED] "Arrest this man, he talks in maths." | www.isi.edu/~hdaume On Sat, 1 Mar 2003, Alexandre Weffort Thenorio wrote: > I am trying to write a small software to take info f

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

2003-03-01 Thread Alexandre Weffort Thenorio
I am trying to write a small software to take info from one file and write it into another file. The problem is that when I don't give any input I get the normal haskell nosuchfile error message but I want to give my own error message. I am a newbie, how can I do that? Also I need the file t

Re: int to float problem

2003-03-01 Thread Ferenc Wagner
"Mike T. Machenry" <[EMAIL PROTECTED]> writes: > I recently desided I wanted a bunch function to return > float instead of Int. [...] I found fromInteger but it > didn't seem to work on the return value of the cardinality > function for instance. Try fromIntegral, which works for Int and Integer,

Re: int to float problem

2003-03-01 Thread Zdenek Dvorak
Hello, [snip] Try intToFloat :: Int -> Float intToFloat n = fromInteger (toInteger n) [snip] Use the Prelude function realToFrac. it sometimes happens to me that I must spend some time browsing prelude to devise somethink like this; it might be useful to have a library for this, that would defin