Re: [Haskell-cafe] Proper round-trip HughesPJ/Parsec for Doubles?

2010-02-23 Thread Lennart Augustsson
If you use read (reads) and show for the actual conversion it will round trip. It appears to be non-trivial since most languages and libraries get it wrong. :) -- Lennart On Tue, Feb 23, 2010 at 1:44 PM, Andy Gimblett wrote: > Hi all, > > Short version: How can I pretty print and parse values

Re: [Haskell-cafe] Proper round-trip HughesPJ/Parsec for Doubles?

2010-02-23 Thread Daniel Fischer
Am Dienstag 23 Februar 2010 14:44:50 schrieb Andy Gimblett: > Hi all, > > Short version: How can I pretty print and parse values of type Double > such that those operations are each other's inverse? > > Long version: I'm writing and QuickCheck-testing a parser using the > approach set out here: > >

[Haskell-cafe] Proper round-trip HughesPJ/Parsec for Doubles?

2010-02-23 Thread Andy Gimblett
Hi all, Short version: How can I pretty print and parse values of type Double such that those operations are each other's inverse? Long version: I'm writing and QuickCheck-testing a parser using the approach set out here: http://lstephen.wordpress.com/2007/07/29/parsec-parser-testing-with