Changes between Initial Version and Version 1 of Ticket #3877


Ignore:
Timestamp:
Feb 12, 2010 2:51:50 PM (5 years ago)
Author:
simonpj
Comment:

Currently this is by design; see http://www.haskell.org/ghc/docs/latest/html/users_guide/type-class-extensions.html#instance-overlap. Note esp the remarks at the end, which point out that the current design is not the only possible one.

So there's no great implementation challenge here; it's a design question.

Simon

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3877 – Description

    initial v1  
    22 
    33The code snippet is:  
     4{{{ 
    45{- File overlap.hs -} 
    56{-# OPTIONS_GHC -XOverlappingInstances -XTypeSynonymInstances #-} 
     
    1112test :: Int -> String -> String 
    1213test a b = show (a,b) 
    13  
     14}}} 
    1415 
    1516The OS is :Linux 2.6.31-19-server #56-Ubuntu SMP x86_64 
     
    1718 
    1819The error message is: 
    19  
     20{{{ 
    2021Glasgow Haskell Compiler, Version 6.12.1, for Haskell 98, stage 2 booted by GHC version 6.8.2 
    2122Using binary package database: /usr/local/lib/ghc-6.12.1/package.conf.d/package.cache 
     
    4041    In the expression: show (a, b) 
    4142    In the definition of `test': test a b = show (a, b)  
     43}}} 
    4244 
    43  
    44  
    45