<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
On 10/22/08 19:52, Daniel Fischer wrote:
<blockquote cite="mid:200810230252.40062.daniel.is.fischer@web.de"
 type="cite">
  <pre wrap="">Am Mittwoch, 22. Oktober 2008 23:44 schrieb Antoine Latter:
  </pre>
  <blockquote type="cite">
    <pre wrap="">On Wed, Oct 22, 2008 at 4:10 PM, Jason Dusek <a class="moz-txt-link-rfc2396E" href="mailto:jason.dusek@gmail.com">&lt;jason.dusek@gmail.com&gt;</a> wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap=""> Can you explain why you think you need that annotation? I
 can't see an ambiguous interpretation of your code.
      </pre>
    </blockquote>
    <pre wrap="">The confusion is that the 'Val' constructor is for the 'Expr' type,
which has a phantom type parameter in its type constructor.

Can you load that up into GHCi and type:
    </pre>
    <blockquote type="cite">
      <pre wrap="">:t val_9
      </pre>
    </blockquote>
    <pre wrap="">which should cause GHCi to print out what it thinks the type of that
expression is.

-Antoine
    </pre>
  </blockquote>
  <pre wrap=""><!---->
ghci correctly thinks that has the type Expr e. Much like
*Main&gt; :t []
[] :: [a]

I think what goes on here is defaulting (deviating from Section 4.3.4 of the 
report, but it's the same deviation that allows [] to be printed). To print 
it, ghci picks some default type for e, probably Integer, as the defaut 
default is (Integer, Double), doesn't influence the result of show.
If you muck around with the Show instance, you can easily get compilation 
errors like "Ambiguous type variable..." (e.g. if you add a (Show e) 
constraint to the Show instance for (Expr e), but not if you add a (Num e) or 
an (Integral e) constraint).
  </pre>
</blockquote>
Thanks Deaniel.&nbsp; The fog in my head begins to clear.<br>
I took Antoine's suggestion and got:<br>
&lt;---cut here ---<br>
GHCi, version 6.8.2: <a class="moz-txt-link-freetext" href="http://www.haskell.org/ghc/">http://www.haskell.org/ghc/</a>&nbsp; :? for help<br>
Loading package base ... linking ... done.<br>
Prelude&gt; :load
"/home/evansl/prog_dev/haskell/my-code/uniplate.try.phantom.hs"<br>
[1 of 1] Compiling Main&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (
/home/evansl/prog_dev/haskell/my-code/uniplate.try.phantom.hs,
interpreted )<br>
Ok, modules loaded: Main.<br>
*Main&gt; let val_9 = Val 9<br>
Loading package mtl-1.1.0.0 ... linking ... done.<br>
Loading package array-0.1.0.0 ... linking ... done.<br>
Loading package containers-0.1.0.1 ... linking ... done.<br>
Loading package uniplate-1.2.0.1 ... linking ... done.<br>
*Main&gt; :t val_9<br>
val_9 :: Expr e<br>
*Main&gt; print val_9<br>
Val 9<br>
*Main&gt; <br>
&gt;---cut here---<br>
I guess the phantom type mentioned in Antoine's post&nbsp; is the e in:<br>
<br>
val_9::Expr e<br>
<br>
?<br>
<br>
</body>
</html>