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

GHC trac at galois.com
Mon May 11 23:12:11 EDT 2009


#3219: functions on records with overloaded names can be given a too-specific type
-----------------------------+----------------------------------------------
Reporter:  dmwit             |          Owner:                         
    Type:  bug               |         Status:  new                    
Priority:  normal            |      Component:  Compiler (Type checker)
 Version:  6.10.1            |       Severity:  normal                 
Keywords:                    |       Testcase:                         
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple       
-----------------------------+----------------------------------------------
 Here's a reduced test-case showing a discrepancy between the symmetric
 functions `foo` and `bar`; the inferred type for `foo` is too specific.

 {{{
 data T a = A{ m1 :: a } | B{ m1, m2 :: a } | C{ m2 :: a }

 -- bar :: (t -> a) -> T t -> T a
 bar f x@(A m) = x{m1 = f m}

 -- foo :: (a -> a) -> T a -> T a
 foo f x@(C m) = x{m2 = f m}
 }}}

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


More information about the Glasgow-haskell-bugs mailing list