Paul Johnson wrote:

> class (Eq a) => AppEq f a where

> instance (Applicative f, Eq a) => AppEq f a where
> instance (Ord a) => AppEq Interval a where

In Haskell, instances are selected based solely on the types in the
head. Constraints like `Applicative f' are not consulted when the
instance is being selected. Rather, constraints are checked after the
instance has been selected. The above two instances are overlapping
since Interval is a particular case of `f'.

That said, it is possible to select an instance based on
constraints. The approach is described at

        http://haskell.org/haskellwiki/GHC/AdvancedOverlap

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to