[GHC] #4841: TypeSynonymInstances allow some flexible instances

GHC cvs-ghc at haskell.org
Mon Dec 13 20:06:09 CET 2010


#4841: TypeSynonymInstances allow some flexible instances
---------------------------------+------------------------------------------
    Reporter:  benmachine        |       Owner:                             
        Type:  bug               |      Status:  new                        
    Priority:  normal            |   Component:  Compiler                   
     Version:  7.0.1             |    Keywords:                             
    Testcase:                    |   Blockedby:                             
          Os:  Unknown/Multiple  |    Blocking:                             
Architecture:  Unknown/Multiple  |     Failure:  GHC accepts invalid program
---------------------------------+------------------------------------------
 The docs for !TypeSynonymInstances say:

   As always, using a type synonym is just shorthand for writing the RHS of
 the type synonym definition.

 However, there are instances that can be defined with ''only''
 !TypeSynonymInstances enabled that cannot be defined without it. The
 following compiles:

 {{{
 {-# LANGUAGE TypeSynonymInstances #-}
 instance Bounded String where
   minBound = ""
   maxBound = maxBound : maxBound
 }}}

 even though the same with `[Char]` does not.

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



More information about the Glasgow-haskell-bugs mailing list