On 25-Jan-2002, Hal Daume III [EMAIL PROTECTED] wrote:
consider the following definition:
class C a where foo :: a - Int
instance C Bool where foo _ = 5
I can then say:
bar :: C a = a - Int
bar (x :: a) = foo (undefined :: a)
But not:
bar :: C a = a - Int
bar x = foo
| I can then say:
|
| bar :: C a = a - Int
| bar (x :: a) = foo (undefined :: a)
|
| But not:
|
| bar :: C a = a - Int
| bar x = foo (undefined :: a)
|
| because it tries to use a new scope for the type variable a and
| doesn't unify it with the one in the type spec. Why
At 2002-01-25 14:00, Hal Daume III wrote:
class D a where constMember :: Int
instance D Int where constMember = 8
It seems ehre that there's no way to extract constMember for a
/particular/ class, since you can't tell it what a is supposed to
be. So, instead, I do:
class D a where