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). While I've worked around these shortcomings in the past
> I feel that I am reinventing the wheel as surely I am not the only to
> run into these limitations. How do you parse your floats? Can you
> recommend a parsing library that handles them solidly?
> 
> (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.)

  fmap fst . listToMaybe . reads

jcc


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to