<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<blockquote
cite="mid:CABvBrA3R=JaBUyHFyLQ5FSTGHF299-5jH0KYvVtz8R4sgHYoPQ@mail.gmail.com"
type="cite">
<p>by</p>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<pre> (parser . prettyPrint . parser) = id </pre>
</blockquote>
<p>I meant </p>
<pre>(prettyPrint . parser . prettyPrint) = id</pre>
<p>for a valid input.</p>
</blockquote>
<p>Simplifying, <tt>(parser ∷ String → something)</tt>, and <tt>(prettyPrint
∷ something → String)</tt>.</p>
<p>Therefore, <tt>(parser . prettyPrint . parser ∷ String →
something)</tt> and <tt>(prettyPrint . parser . prettyPrint ∷
something → String)</tt>.</p>
<p>Therefore, both criteria could only apply for <tt>(something ~
String)</tt>. But as pretty printing adds quotation marks, not
even that is true.</p>
<p>There are four formulations that might be applicable:</p>
<ol>
<li>
<p> <tt>parser . prettyPrint ≍ id <br>
</tt></p>
</li>
<li>
<p><tt>prettyPrint . parser </tt><tt><tt>≍</tt> id -- ∷ String
→ String, useless here<br>
</tt></p>
</li>
<li>
<p> <tt>prettyPrint . parser . </tt><tt><tt>prettyPrint</tt> </tt><tt><tt>≍</tt>
</tt><tt>prettyPrint</tt></p>
</li>
<li>
<p><tt>parser . prettyPrint . parser </tt><tt><tt>≍</tt> </tt><tt>parser</tt></p>
</li>
<li>Well, you could go beyond to <tt>(</tt><tt>prettyPrint .
parser . </tt><tt>prettyPrint</tt><tt> . pa</tt><tt>rser </tt><tt>≍</tt><tt>
</tt><tt>prettyPrint</tt><tt> . </tt><tt>parser</tt><tt>)</tt>
etc…<br>
</li>
</ol>
<p>I don't think 1 (or 2) follow from one of the last two. But 1
does imply them. So it is a stronger criterion than both, and
therefore probably not the one to choose. Assuming the parser is
internally consistent, 3 just says something about the internal
consistency of the pretty printer, while 4 says something about
the relationship of the pretty printer to the parser. Thus 4 looks
like the best candidate for a criterion. Possibly with 3 as a
secondary target.</p>
<p>Cheers,<br>
MarLinn</p>
</body>
</html>