[Haskell-cafe] newbie question about Functional dependencies conflict between instance declarations:.....

2013-07-05 Thread Nicholls, Mark
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 -

Re: [Haskell-cafe] newbie question about Functional dependencies conflict between instance declarations:.....

2013-07-05 Thread Erik Hesselink
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

Re: [Haskell-cafe] newbie question about Functional dependencies conflict between instance declarations:.....

2013-07-05 Thread Tikhon Jelvis
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

Re: [Haskell-cafe] newbie question about Functional dependencies conflict between instance declarations:.....

2013-07-05 Thread Nicholls, Mark
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