[GHC] #927: Type checker infers () instead of a

GHC trac at galois.com
Sat Oct 7 18:39:49 EDT 2006


#927: Type checker infers () instead of a
-------------------------+--------------------------------------------------
    Reporter:  guest     |        Owner:         
        Type:  bug       |       Status:  new    
    Priority:  normal    |    Milestone:         
   Component:  Compiler  |      Version:  6.4.1  
    Severity:  normal    |     Keywords:         
          Os:  Windows   |   Difficulty:  Unknown
Architecture:  x86       |  
-------------------------+--------------------------------------------------
A small module loaded into ghci -fglasgow-exts 6.4.1:

 module M where

 class C a b | a -> b where
   same :: a -> b

 instance C () ()

 instance C a b => C (c -> a) (c -> b)

 foo = same (const ())

 Asking :i foo yields

 foo :: () -> ()

 I would expect a -> () -- what gives?

 John Hughes

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


More information about the Glasgow-haskell-bugs mailing list