[commit: ghc] wip/type-app: Update user manual re @_. (556af58)
git at git.haskell.org
git at git.haskell.org
Fri Aug 7 12:08:10 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/type-app
Link : http://ghc.haskell.org/trac/ghc/changeset/556af581baa8f6c934849231b8dd4859cacf61e7/ghc
>---------------------------------------------------------------
commit 556af581baa8f6c934849231b8dd4859cacf61e7
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date: Thu Aug 6 11:43:44 2015 -0400
Update user manual re @_.
>---------------------------------------------------------------
556af581baa8f6c934849231b8dd4859cacf61e7
docs/users_guide/glasgow_exts.xml | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml
index d77eacc..b523210 100644
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -2658,6 +2658,16 @@ not have a type signature, visible type application cannot be used.</para>
we can have <literal>pair :: forall a. a -> forall b. b -> (a, b)</literal>
and then say <literal>pair @Bool True @Char</literal> which would have
type <literal>Char -> (Bool, Char)</literal>.</para></listitem>
+
+ <listitem><para>Partial type signatures (<xref
+ linkend="partial-type-signatures"/>) work nicely with visible type
+ application. If you want to specify only the second type argument to
+ <literal>wurble</literal>, then you can say <literal>wurble @_ @Int</literal>.
+ The first argument is a wildcard, just like in a partial type signature.
+ However, if used in a visible type application, it is <emphasis>not</emphasis>
+ necessary to specify <option>-XPartialTypeSignatures</option> and your
+ code will not generate a warning informing you of the omitted type.
+ </para></listitem>
</itemizedlist>
</sect3>
More information about the ghc-commits
mailing list