
#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