<div dir="ltr"><div>Ok, this all works as expected:</div><div><br></div><div><div>λ> data Point = Point Float Float deriving (Show, Read)</div><div>λ> Point 1.0 1.0</div><div>Point 1.0 1.0</div><div>λ> read "Point 1.0 1.0"</div><div>*** Exception: Prelude.read: no parse</div><div>λ> read "Point 1.0 1.0" :: Point</div><div>Point 1.0 1.0</div></div><div><br></div><div>But now we add names to the values in the Point, and things change:</div><div><br></div><div><div>λ> data Point = Point {x :: Float, y :: Float } deriving (Show, Read)</div><div>λ> Point 1.0 1.0</div><div>Point {x = 1.0, y = 1.0}</div><div>λ> read "Point 1.0 1.0"</div><div>*** Exception: Prelude.read: no parse</div><div>λ> read "Point 1.0 1.0" :: Point</div><div>*** Exception: Prelude.read: no parse</div><div>λ> read "Point {x = 1.0, y = 1.0 }" :: Point</div><div>Point {x = 1.0, y = 1.0}</div></div><div><br></div><div>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?</div><div><br></div></div>