[GHC] #3219: functions on records with overloaded names can be given a too-specific type

GHC trac at galois.com
Tue May 12 07:06:58 EDT 2009


#3219: functions on records with overloaded names can be given a too-specific type
----------------------------------------+-----------------------------------
    Reporter:  dmwit                    |        Owner:                  
        Type:  bug                      |       Status:  closed          
    Priority:  normal                   |    Milestone:                  
   Component:  Compiler (Type checker)  |      Version:  6.10.1          
    Severity:  normal                   |   Resolution:  invalid         
    Keywords:                           |   Difficulty:  Unknown         
    Testcase:                           |           Os:  Unknown/Multiple
Architecture:  Unknown/Multiple         |  
----------------------------------------+-----------------------------------
Changes (by simonpj):

  * status:  new => closed
  * difficulty:  => Unknown
  * resolution:  => invalid

Comment:

 What you say is true but depends, in a way that's invisible to the type
 system, on the pattern match on C. If you had
 {{{
 -- foo1 :: (a -> a) -> T a -> T a
 foo1 f x = x{m2 = f m}
 }}}
 then indeed the inferred type would be right.

 For better or worse, the type system takes no account of which data
 constructors are matched in an enclosing context ''except'' for GADTs, and
 that is a different story.

 In short, this is more of a feature request than a bug, so I'll close it
 as invalid.  If you want to make a feature request, by all means do, but
 personally I doubt that there'd be a big market for it.

 Simon

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


More information about the Glasgow-haskell-bugs mailing list