l-cafe] newbie question about "Functional dependencies
conflict between instance declarations:".
You're running into the "open world"assumption--anybody could come along and
make Integer part of your NotAnInteger class, and there's nothing you can do to
stop
You're running into the "open world"assumption--anybody could come along
and make Integer part of your NotAnInteger class, and there's nothing you
can do to stop them. This is a design tradeoff for typeclasses: typeclass
instances are always global and are exported to all other modules you use.
Thi
The constraint on an instance never influences which instance is
selected. So as far as instance selection goes, 'instance Foo x' and
'instance C x => Foo x' are the same. The constraint is only checked
after the instance is selected.
Erik
On Fri, Jul 5, 2013 at 2:43 PM, Nicholls, Mark wrote:
>
Hello,
I largely don't know what I'm doing or even trying to do, it is a voyage into
the unknownbutif I go...
> {-# LANGUAGE MultiParamTypeClasses #-}
> {-# LANGUAGE FunctionalDependencies #-}
> {-# LANGUAGE FlexibleInstances #-}
> {-# LANGUAGE UndecidableInstances #-}
> class Foo x y |