<p dir="ltr"><br>
</p>
<p dir="ltr">On Mon, Jul 27, 2015, 15:56 Brandon Allbery <<a href="mailto:allbery.b@gmail.com">allbery.b@gmail.com</a>> wrote:</p>
<p dir="ltr"><br>
</p>
<blockquote><p dir="ltr">On Mon, Jul 27, 2015 at 4:25 PM, Mike Meyer <<a href="mailto:mwm@mired.org">mwm@mired.org</a>> wrote:</p>
</blockquote>
<blockquote><p dir="ltr"><br>
</p>
</blockquote>
<blockquote><blockquote><p dir="ltr">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?</p>
</blockquote>
</blockquote>
<blockquote><blockquote><p dir="ltr"><br>
</p>
</blockquote>
</blockquote>
<blockquote><p dir="ltr"><br>
Partly because ReadS isn't a very good parser, partly because of compliance with <a href="https://www.haskell.org/onlinereport/haskell2010/haskellch11.html#x18-18600011.4">https://www.haskell.org/onlinereport/haskell2010/haskellch11.html#x18-18600011.4</a>; notably:If the constructor is defined using record syntax, the derived Read will parse only the record-syntax form, and furthermore, the fields must be given in the same order as the original declaration.</p>
</blockquote>
<blockquote><p dir="ltr"><br>
</p>
</blockquote>
<p dir="ltr"><br>
</p>
<p dir="ltr">So why does the REPL read not follow those rules? And is there some way to use whatever the REPL is using as the read instance in my code?</p>