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 | x -
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
You're running into the open worldassumption--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.
This
Functional dependencies
conflict between instance declarations:.
You're running into the open worldassumption--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