Hello,
I was thinking that it could maybe be useful to allow duplicate instance
declarations, if the class has no methods. From my naive point of view, i
can not see problems, scince there are no conflicting methods to choose
from. But the following program fails to be compiled by ghc-6.6
Did you try to compile with -fallow-overlapping-instances
On 3/6/07, mm [EMAIL PROTECTED] wrote:
Hello,
I was thinking that it could maybe be useful to allow duplicate instance
declarations, if the class has no methods. From my naive point of view, i
can not see problems, scince
that it could maybe be useful to allow duplicate instance
declarations, if the class has no methods. From my naive point of view, i
can not see problems, scince there are no conflicting methods to choose
from. But the following program fails to be compiled by ghc-6.6:
{-# OPTIONS -fglasgow-exts
Alfonso Acosta:
Did you try to compile with -fallow-overlapping-instances
mm [EMAIL PROTECTED]:
Same effect:
ghc -fallow-overlapping-instances --make test5.lhs
[1 of 1] Compiling Main ( test5.lhs, test5.o )
test5.lhs:22:1:
Duplicate instance declarations:
instance
Hello Ashley,
Wednesday, December 28, 2005, 1:56:51 AM, you wrote:
instance (CharStream h) = BufStream h where
instance (MemoryStream h) = BufStream h where
AY Try this:
AY class (BufStream h) = CharStream h where
AY class (BufStream h) = MemoryStream h where
thank you, that will work,
Hello Ashley,
Wednesday, December 28, 2005, 1:56:51 AM, you wrote:
i tried to implement your solution and failed. i will extend my
original example to show you my problem:
class BufStream h where
vPutBuf :: h - Ptr a - Int - IO ()
class CharStream h where
vPutStr :: h - String - IO
Bulat Ziganshin wrote:
Hello all
why the folowing is not allowed even with all extensions enabled both
in Hugs and GHC?
class BufStream h where
class CharStream h where
instance (CharStream h) = BufStream h where
class MemoryStream h where
instance (MemoryStream h) = BufStream h where
Try