[GHC] #12024: GHC leaks GHC.Prim.~# into type

GHC ghc-devs at haskell.org
Sat May 7 00:53:20 UTC 2016


#12024: GHC leaks GHC.Prim.~# into type
-------------------------------------+-------------------------------------
           Reporter:  Iceland_jack   |             Owner:
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  7.10.3
  (Type checker)                     |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 {{{#!hs
 data A a where
   X :: A [xxx]

 pattern X' = X
 }}}

 the inferred type of which is

 {{{
 >>> :info X'
 pattern X' :: () => t GHC.Prim.~# [xxx] => A t
 }}}

 Casts use unlifted equality as I understand it, but lifted would present a
 nicer UI:

 {{{#!hs
 pattern X' :: () => t ~> [xxx] => A t
 pattern X' = X
 }}}

 In my own code this means I get the following monster

 {{{#!hs
 pattern MkArr :: () => (GetTy a, GetTy b, GetTy t,
                         a GHC.Prim.~# 'Sca ('Number 'I32), b GHC.Prim.~#
 'Sca a1,
                         t GHC.Prim.~# 'Arr a1, GetSca a1) => Exp a -> Id
 -> Exp b -> Exp t
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12024>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list