[GHC] #5938: Kind variables not allowed in type family instance declarations

GHC cvs-ghc at haskell.org
Fri Apr 20 18:07:38 CEST 2012


#5938: Kind variables not allowed in type family instance declarations
---------------------------------------+------------------------------------
 Reporter:  goldfire                   |          Owner:                         
     Type:  bug                        |         Status:  new                    
 Priority:  normal                     |      Component:  Compiler (Type checker)
  Version:  7.5                        |       Keywords:  PolyKinds              
       Os:  Unknown/Multiple           |   Architecture:  Unknown/Multiple       
  Failure:  GHC rejects valid program  |       Testcase:                         
Blockedby:                             |       Blocking:                         
  Related:                             |  
---------------------------------------+------------------------------------

Comment(by simonpj@…):

 commit c5554f8290f5acc5f52ab1ea6488a75d0ffa34e5
 {{{
 Author: Simon Peyton Jones <simonpj at microsoft.com>
 Date:   Fri Apr 13 21:40:56 2012 +0100

     Allow kind-variable binders in type signatures

     This is the last major addition to the kind-polymorphism story,
     by allowing (Trac #5938)

      type family F a   -- F :: forall k. k -> *
      data T a          -- T :: forall k. k -> *
      type instance F (T (a :: Maybe k)) = Char

     The new thing is the explicit 'k' in the type signature on 'a',
     which itself is inside a type pattern for F.

     Main changes are:

     * HsTypes.HsBSig now has a *pair* (kvs, tvs) of binders,
       the kind variables and the type variables

     * extractHsTyRdrTyVars returns a pair (kvs, tvs)
       and the function itself has moved from RdrHsSyn to RnTypes

     * Quite a bit of fiddling with
          TcHsType.tcHsPatSigType and tcPatSig
       which have become a bit simpler.  I'm still not satisfied
       though.  There's some consequential fiddling in TcRules too.

     * Removed the unused HsUtils.collectSigTysFromPats

     There's a consequential wibble to Haddock too

  compiler/deSugar/DsMeta.hs          |    8 ++-
  compiler/hsSyn/HsTypes.lhs          |   11 +++-
  compiler/hsSyn/HsUtils.lhs          |   34 +---------
  compiler/parser/Parser.y.pp         |    6 +-
  compiler/parser/ParserCore.y        |    2 +-
  compiler/parser/RdrHsSyn.lhs        |   64 -----------------
  compiler/rename/RnSource.lhs        |   12 ++--
  compiler/rename/RnTypes.lhs         |  133
 +++++++++++++++++++++++++++++++---
  compiler/typecheck/TcHsType.lhs     |  111 ++++++++++++++++++------------
  compiler/typecheck/TcMType.lhs      |   37 +++-------
  compiler/typecheck/TcRules.lhs      |   48 ++++++-------
  compiler/typecheck/TcTyClsDecls.lhs |   40 +++++++++--
  compiler/typecheck/TcType.lhs       |    3 +
  13 files changed, 283 insertions(+), 226 deletions(-)
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5938#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list