Given
class C a where
m :: a -> ()
instance C () where
m() = ()
we observed the following behaviour:
(0) Error with GHC and Hugs:
f = \x -> m x
(1) OK with GHC and Hugs:
f1 x = m x
(2) OK with GHC and Hugs:
f :: C a => a -> ()
f = \x -> m x
(3) OK with GHC, error with Hugs:
f = \x -> m x
x = f()
Case (0) produces an ambiguity error. The question is:
- What is the difference between (0) and (1)?
- Why can the type given in (2) not be inferred?
- Is GHC's treatment of (3) a bug?
--
Gerhard Schneider <[EMAIL PROTECTED]>
http://www.ps.uni-sb.de/~gesc/
PGP Pubic Key: http://www.trustcenter.de