Changes between Initial Version and Version 1 of Ticket #5095


Ignore:
Timestamp:
Jul 15, 2011 9:25:36 PM (3 years ago)
Author:
igloo
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5095 – Description

    initial v1  
    11If we create a new module allowing overlapping instances, flexible instances and undecidable instances we can define a function that selects an incoherent instance for a type class defined in the Prelude. Example: 
    2  
     2{{{ 
    33> {-# OPTIONS -XFlexibleInstances -XOverlappingInstances -XUndecidableInstances #-} 
    44 
     
    1212> 
    1313> p = f (3 :: Int) 4 
    14  
     14}}} 
    1515The instance selected here (tested with GHC 7.0 and 6.12) is the one in this module, even if the instance Eq Int from the Prelude is more specific. If we try to reproduce a similar example using a module other than the Prelude, an incoherent instances error is reported. I believe that, for consistency the same should happen here.