[GHC] #11952: automatic show instance generating loop

#11952: automatic show instance generating loop --------------------------------+------------------------------------- Reporter: maxigit | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Keywords: | Operating System: Unknown/Multiple Architecture: x86 | Type of failure: None/Unknown Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: --------------------------------+------------------------------------- I have the following code : {{{#!hs {-# LANGUAGE TypeFamilies, DataKinds #-} data Status = Valid | Invalid deriving(Show) data A s = A (TF s) type family TF (s:: Status) where TF Valid = Int TF Invalid = Either String Int instance Show (A Valid) instance Show (A Invalid) a :: A Valid a = A 3 }}} Printing `a` results in a stackoverflow. I'm using GHC-7.10.3 (and 7.8.4) on Ubuntu under a VM -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11952 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11952: automatic show instance generating loop -------------------------------------+------------------------------ Reporter: maxigit | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: x86 Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------ Changes (by kosmikus): * status: new => closed * resolution: => invalid Comment: An empty instance for `show` is not automatic. It uses the default definitions, which are defined in terms of each other. You can use `StandaloneDeriving` and say {{{ deriving instance Show (A Valid) deriving instance Show (A Invalid) }}} instead and it will work just fine. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11952#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC