#5858: type inference of  an OverloadedString for a class instance with type
parameters
---------------------------------+------------------------------------------
    Reporter:  GregWeber         |       Owner:                  
        Type:  bug               |      Status:  new             
    Priority:  normal            |   Milestone:                  
   Component:  Compiler          |     Version:  7.4.1           
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:                    |  
---------------------------------+------------------------------------------

Comment(by GregWeber):

 Thanks, your suggestion did fix the inference. Here is a small test
 program

 {{{
 {-# LANGUAGE FlexibleInstances, GADTs #-}
 module InferOverloaded where

 class InferOverloaded a where
   infer :: a -> String

 -- instance (t1 ~ String, t2 ~ String) => InferOverloaded (t1,t2) where
 instance (t1 ~ String) => InferOverloaded (t1,t1) where
   infer = show . fst

 foo = infer ([],[])
 }}}

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to