<div dir="ltr"><div class="gmail_extra">On Fri, Jul 26, 2013 at 5:08 PM, Micah Cowan <span dir="ltr">&lt;<a href="mailto:micah@cowan.name" target="_blank">micah@cowan.name</a>&gt;</span> wrote:<br><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":9gt" style="overflow:hidden">I was wondering if there was a way to do it in &quot;pure&quot; Haskell (i.e., no<br>

GHC pragmas required), and also the specific reason for why the above<br>
example doesn&#39;t work without the pragma (I think it&#39;s just that in<br>
general a -&gt; b is not syntactically allowed for type specifiers within<br>
instance declarations)?</div></blockquote></div><br>The error message you get without the pragma tells you exactly what&#39;s wrong, and that&#39;s not it.</div><div class="gmail_extra"><br></div><div class="gmail_extra">
Standard Haskell is *very* conservative about what it allows in an instance declaration; you may not have literal types, nor may you repeat a type variable, only things of the form (Type var1 var2 ...) are permitted. (The (String -&gt; String) is not syntactically a problem; it&#39;s read as ((-&gt;) String String) which would conform *if* it didn&#39;t use literal types. You can verify this by rephrasing it in prefix form --- note the error message uses the infix form even if you phrase it as a prefix!) This is widely seen as unnecessarily restrictive.<br clear="all">
<div><br></div>-- <br><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div>
<div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div>
</div></div>