[commit: ghc] master: Update user's guide after D2490 (e8ae4dc)

git at git.haskell.org git at git.haskell.org
Fri Nov 11 04:51:04 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/e8ae4dc8558b5917f6c65ad196859783e90038bd/ghc

>---------------------------------------------------------------

commit e8ae4dc8558b5917f6c65ad196859783e90038bd
Author: Thomas Winant <thomas.winant at cs.kuleuven.be>
Date:   Thu Nov 10 15:22:14 2016 -0500

    Update user's guide after D2490
    
    D2490 added support for type wildcards in TH pattern splices. The user's
    guide still said that they were not supported, this patch fixes this.
    
    Test Plan: build documentation
    
    Reviewers: goldfire, austin, mvv, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2686
    
    GHC Trac Issues: #12164


>---------------------------------------------------------------

e8ae4dc8558b5917f6c65ad196859783e90038bd
 docs/users_guide/glasgow_exts.rst | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst
index 3c340fe..38afb3b 100644
--- a/docs/users_guide/glasgow_exts.rst
+++ b/docs/users_guide/glasgow_exts.rst
@@ -9997,9 +9997,14 @@ splices.
 -  Typed expression splices: the same wildcards as in (untyped)
    expression splices are supported.
 
--  Pattern splices: Template Haskell doesn't support type signatures in
-   pattern splices. Consequently, partial type signatures are not
-   supported either.
+-  Pattern splices: anonymous and named wildcards can be used in pattern
+   signatures. Note that :ghc-flag:`-XScopedTypeVariables` has to be enabled
+   to allow pattern signatures. Extra-constraints wildcards are not supported,
+   just like in regular pattern signatures.
+   ::
+
+       {-# LANGUAGE TemplateHaskell, ScopedTypeVariables #-}
+       foo $( [p| (x :: _) |] ) = x
 
 -  Type splices: only anonymous wildcards are supported in type splices.
    Named and extra-constraints wildcards are not. ::



More information about the ghc-commits mailing list