Functional dependencies question

Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl
Mon, 19 May 2003 17:02:48 +0200


Dnia wto 13. maja 2003 09:58, Simon Peyton-Jones napisał:

> Think of it like this.  Should this be acceptable?
>
> 	f :: a -> a -> a
> 	f x y = x && y
>
> No, because the type (forall a. a->a->a) is plainly more general than
> the actual function.

It's not the same. The type doesn't constrain a by any class, so it would look 
like any type fits, which is not true.

> 	bar :: (Foo Char t) => t

In this case the type seems OK: for any type t, *if* Foo Char t, then bar can 
be used as type t.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak@knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/