<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>What version of the GHC code are you looking at? The parser is currently stored in compiler/parser/Parser.y.pp (note the pp) and doesn’t have these lines. As far as I know, there is no way to refer to OpenKind from source.</div><div><br></div><div>You’re absolutely right about the type of `undefined`. `undefined` (and `error`) have magical types. GHC knows that GHC.Err defines an `undefined` symbol and gives it its type by fiat. There is no way (I believe) to reproduce this behavior.</div><div><br></div><div>If you have -fprint-explicit-foralls and -fprint-explicit-kinds enabled, quantified variables of kind * are not given kinds in the output. So, the lack of a kind annotation tells you that `a`’s kind is *. Any other kind (assuming these flags) would be printed.</div><div><br></div><div>I hope this helps!</div><div>Richard</div><br><div><div>On Apr 15, 2014, at 7:39 PM, Conal Elliott <<a href="mailto:conal@conal.net">conal@conal.net</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div><div>I see ‘#’ for unlifted and ‘?’ for open kinds in compiler/parser/Parser.y:
<pre style="margin-left:40px"><code>akind   :: { IfaceKind }
        : '*'              { ifaceLiftedTypeKind }      
        | '#'              { ifaceUnliftedTypeKind }
        | '?'              { ifaceOpenTypeKind }
        | '(' kind ')'     { $2 }

kind    :: { IfaceKind }
        : akind            { $1 }
        | akind '->' kind  { ifaceArrow $1 $3 }</code></pre><p>However, I don’t know how to get GHC to accept ‘#’ or ‘?’ in a kind 
annotation. Are these kinds really available to source programs.</p><p>I see that undefined has an open-kinded type:</p>
<pre style="margin-left:40px"><code>*Main> :i undefined
undefined :: forall (a :: OpenKind). a      -- Defined in ‘GHC.Err’</code></pre><p>Looking in the GHC.Err source, I just see the following:</p>
<pre style="margin-left:40px"><code>undefined :: a
undefined =  error "Prelude.undefined"</code></pre><p>However, if I try similarly,</p>
<pre style="margin-left:40px"><code>q :: a
q = error "q"</code></pre><p>I don’t see a similar type:</p>
<pre style="margin-left:40px"><code>*X> :i q
q :: forall a. a        -- Defined at ../test/X.hs:12:1</code></pre><br></div>I don't know what kind 'a' has here, nor how to find out.<br><br></div>-- Conal<br></div>
_______________________________________________<br>Glasgow-haskell-users mailing list<br><a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br>http://www.haskell.org/mailman/listinfo/glasgow-haskell-users<br></blockquote></div><br></body></html>