[project @ 2004-04-05 11:14:29 by simonpj]
authorsimonpj <unknown>
Mon, 5 Apr 2004 11:14:30 +0000 (11:14 +0000)
committersimonpj <unknown>
Mon, 5 Apr 2004 11:14:30 +0000 (11:14 +0000)
Document :kind

ghc/compiler/ghci/InteractiveUI.hs
ghc/docs/users_guide/ghci.sgml

index 7977305..7a80aa5 100644 (file)
@@ -1,6 +1,6 @@
 {-# OPTIONS -#include "Linker.h" #-}
 -----------------------------------------------------------------------------
--- $Id: InteractiveUI.hs,v 1.164 2004/04/05 10:50:26 simonpj Exp $
+-- $Id: InteractiveUI.hs,v 1.165 2004/04/05 11:14:30 simonpj Exp $
 --
 -- GHC Interactive User Interface
 --
@@ -134,6 +134,7 @@ helpText = "\
 \   :show bindings            show the current bindings made at the prompt\n\ 
 \\n\ 
 \   :type <expr>              show the type of <expr>\n\ 
+\   :kind <type>              show the kind of <type>\n\ 
 \   :undef <cmd>              undefine user-defined command :<cmd>\n\ 
 \   :unset <option> ...               unset options\n\ 
 \   :quit                     exit GHCi\n\ 
index d87c1db..dc391c0 100644 (file)
@@ -63,6 +63,7 @@ Prelude>
    :show bindings             show the current bindings made at the prompt
 
    :type &lt;expr&gt;               show the type of &lt;expr&gt;
+   :kind &lt;type&gt;               show the kind of &lt;type&gt;
    :undef &lt;cmd&gt;               undefine user-defined command :&lt;cmd&gt;
    :unset &lt;option&gt; ...        unset options
    :quit                      exit GHCi
@@ -1059,6 +1060,17 @@ Prelude> :def make (\_ -> return ":! ghc &ndash;&ndash;make Main")
       </varlistentry>
 
       <varlistentry>
+       <term><literal>:kind</literal> <replaceable>type</replaceable></term>
+       <indexterm><primary><literal>:kind</literal></primary></indexterm>
+       <listitem>
+         <para>Infers and prints the kind of
+         <replaceable>type</replaceable>. The latter can be an arbitrary
+           type expression, including a partial application of a type constructor,
+           such as <literal>Either Int</literal>.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
        <term><literal>:undef</literal> <replaceable>name</replaceable></term>
        <indexterm><primary><literal>:undef</literal></primary></indexterm>
        <listitem>