
Ok, this all works as expected: λ> data Point = Point Float Float deriving (Show, Read) λ> Point 1.0 1.0 Point 1.0 1.0 λ> read "Point 1.0 1.0" *** Exception: Prelude.read: no parse λ> read "Point 1.0 1.0" :: Point Point 1.0 1.0 But now we add names to the values in the Point, and things change: λ> data Point = Point {x :: Float, y :: Float } deriving (Show, Read) λ> Point 1.0 1.0 Point {x = 1.0, y = 1.0} λ> read "Point 1.0 1.0" *** Exception: Prelude.read: no parse λ> read "Point 1.0 1.0" :: Point *** Exception: Prelude.read: no parse λ> read "Point {x = 1.0, y = 1.0 }" :: Point Point {x = 1.0, y = 1.0} OK, why won't read accept the same syntax as the REPL? I can see wanting Read and Show to be inverses of each other, though I think it's a bit misguided. But if we're going to be that strict about them being inverses, shouldn't we also insist that the READ eval print loop only accept what read will accept?