[GHC] #9842: No Typeable instance for type-level literals and promoted types (was: No Typeable instance for type-level literals)

GHC ghc-devs at haskell.org
Thu Nov 27 17:17:12 UTC 2014


#9842: No Typeable instance for type-level literals and promoted types
-------------------------------------+-------------------------------------
              Reporter:  Feuerbach   |            Owner:
                  Type:  bug         |           Status:  closed
              Priority:  normal      |        Milestone:
             Component:  Compiler    |          Version:  7.8.3
            Resolution:  duplicate   |         Keywords:
      Operating System:              |     Architecture:  Unknown/Multiple
  Unknown/Multiple                   |       Difficulty:  Unknown
       Type of failure:              |       Blocked By:
  None/Unknown                       |  Related Tickets:  #8778
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
Description changed by Feuerbach:

Old description:

> There's no Typeable instance for string and numeric literals. E.g.
>
> {{{
> Prelude GHC.TypeLits Data.Typeable> typeRep (Proxy :: Proxy "foo")
>
> <interactive>:15:1:
>     No instance for (Typeable "foo") arising from a use of ‘typeRep’
>     In the expression: typeRep (Proxy :: Proxy "foo")
>     In an equation for ‘it’: it = typeRep (Proxy :: Proxy "foo")
> }}}
>
> This means that we can't have a Typeable instance for phantom types
> parameterised by these literals.

New description:

 There's no Typeable instance for string and numeric literals. E.g.

 {{{
 Prelude GHC.TypeLits Data.Typeable> typeRep (Proxy :: Proxy "foo")

 <interactive>:15:1:
     No instance for (Typeable "foo") arising from a use of ‘typeRep’
     In the expression: typeRep (Proxy :: Proxy "foo")
     In an equation for ‘it’: it = typeRep (Proxy :: Proxy "foo")
 }}}

 This means that we can't have a Typeable instance for phantom types
 parameterised by these literals.

 Ditto for the promoted data types:

 {{{
 Prelude Data.Typeable> typeRep (Proxy :: Proxy Nothing)

 <interactive>:4:1:
     No instance for (Typeable 'Nothing) arising from a use of ‘typeRep’
     In the expression: typeRep (Proxy :: Proxy Nothing)
     In an equation for ‘it’: it = typeRep (Proxy :: Proxy Nothing)
 }}}

--

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


More information about the ghc-tickets mailing list