[GHC] #11581: TypeError requires UndecidableInstances unnecessarily

GHC ghc-devs at haskell.org
Thu Feb 18 17:30:53 UTC 2016


#11581: TypeError requires UndecidableInstances unnecessarily
-------------------------------------+-------------------------------------
        Reporter:  rwbarton          |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  low               |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1-rc2
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  GHC rejects       |            Test Case:  indexed-
  valid program                      |  types/should_compile/T11581
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 Great. Now instead of special-casing `TypeError`, I was hoping to do the
 following. Replace
 {{{
 type family TypeError (a :: ErrorMessage) :: b where
 }}}
 with
 {{{
 type family TypeError :: ErrorMessage -> b where
 }}}

 Unfortunately the kind argument `b` is still considered to be an indexed
 argument rather than a parametric argument, as shown by `-fprint-explicit-
 kinds`.
 {{{
 *Pair2> :i GHC.TypeLits.TypeError
 type family GHC.TypeLits.TypeError b (a :: ErrorMessage)
   Kind: forall b1. ErrorMessage -> b1
         -- Defined in ‘GHC.TypeLits’
 *Pair2> :i TypeError
 type family TypeError b
   Kind: forall b1. ErrorMessage -> b1
         -- Defined at Pair2.hs:16:1
 }}}
 Can we make `b` a parametric argument, i.e., `TypeError` have arity 0,
 even counting kind arguments? Then we wouldn't need a special case for
 `TypeError` at all.

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


More information about the ghc-tickets mailing list