[GHC] #12837: KnownNat and KnownSymbol should be abstract

GHC ghc-devs at haskell.org
Mon Nov 14 21:41:26 UTC 2016


#12837: KnownNat and KnownSymbol should be abstract
-------------------------------------+-------------------------------------
           Reporter:  adamgundry     |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:  newcomer       |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  GHC accepts
  Unknown/Multiple                   |  invalid program
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Consider the following patent nonsense:

 {{{#!hs
 {-# LANGUAGE FlexibleInstances #-}
 import GHC.TypeLits
 instance KnownNat n
 }}}

 This is accepted (albeit with a warning about the missing `natSing`
 method). I think it should be rejected, as should an instance of
 `KnownSymbol`. Compare doing the same thing with `Typeable`, which says:

 {{{
     Class ‘Typeable’ does not support user-specified instances
 }}}

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


More information about the ghc-tickets mailing list