| > 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
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 -
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 wh
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 (undefined :: a)
because it tries to use a new scope for the t