Re: [Haskell-cafe] Parsing floating point numbers

2009-03-09 Thread Henning Thielemann
On Sun, 8 Mar 2009, Felipe Lessa wrote: On Sun, Mar 8, 2009 at 9:34 PM, Bjorn Buckwalter bjorn.buckwal...@gmail.com wrote: (For my current needs the formats accepted by read are sufficient, but I want reasonable error handling (Maybe or Either) instead of an exception on bad inputs.) Why

Re: [Haskell-cafe] Parsing floating point numbers

2009-03-09 Thread Malcolm Wallace
Bjorn Buckwalter bjorn.buckwal...@gmail.com wrote: What is your preferred method of parsing floating point numbers (from String to Float/Double)? Parsec it seems only does positive floats out of the box and PolyParse requires the float to be on scientific form (exponential). Thanks for the

Re: [Haskell-cafe] Parsing floating point numbers

2009-03-09 Thread Daniel Schüssler
Although maybeRead was proposed, I cannot find it: here's a replacement... http://hackage.haskell.org/packages/archive/safe/0.2/doc/html/Safe.html#v%3AreadMay Greetings, Daniel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Parsing floating point numbers

2009-03-08 Thread Bjorn Buckwalter
Hi all, What is your preferred method of parsing floating point numbers (from String to Float/Double)? Parsec it seems only does positive floats out of the box and PolyParse requires the float to be on scientific form (exponential). While I've worked around these shortcomings in the past I feel

Re: [Haskell-cafe] Parsing floating point numbers

2009-03-08 Thread Jonathan Cast
On Sun, 2009-03-08 at 19:34 -0500, Bjorn Buckwalter wrote: Hi all, What is your preferred method of parsing floating point numbers (from String to Float/Double)? Parsec it seems only does positive floats out of the box and PolyParse requires the float to be on scientific form (exponential).

Re: [Haskell-cafe] Parsing floating point numbers

2009-03-08 Thread Felipe Lessa
On Sun, Mar 8, 2009 at 9:34 PM, Bjorn Buckwalter bjorn.buckwal...@gmail.com wrote: (For my current needs the formats accepted by read are sufficient, but I want reasonable error handling (Maybe or Either) instead of an exception on bad inputs.) Why not readM :: (Monad m, Read a) = String - m

Re: [Haskell-cafe] Parsing floating point numbers

2009-03-08 Thread Daniel Peebles
If you're working with ByteStrings, http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bytestring-lexing might help. Cheers, Dan On Sun, Mar 8, 2009 at 8:34 PM, Bjorn Buckwalter bjorn.buckwal...@gmail.com wrote: Hi all, What is your preferred method of parsing floating point numbers