<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 27, 2015 at 1:25 PM, Mike Meyer <span dir="ltr"><<a href="mailto:mwm@mired.org" target="_blank">mwm@mired.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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></div></blockquote><div><br></div><div>This works because the type of Point is Point :: Float -> Float -> Point.</div><div><br></div><div>You could have equally written:</div><div>> let foo = Point</div><div>> foo 1.0 1.0</div><div><br></div><div>The parser at the REPL is looking for arbitrary Haskell expressions, and "Point 1.0 1.0" just happens to be a function application expression.</div><div><br></div><div>I hope that helps,</div><div>Jason</div></div></div></div>