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

2013-07-05 Thread Nicholls, Mark
I haven't declared integer to be NotAnIntegerso (in a closed world)this would seem to exclude the contradictionbut... Functional dependencies conflict between instance declarations: instance Foo Integer Integer -- Defined at liam1.lhs:7:12 instance NotAnInteger x = Foo

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

2013-07-05 Thread Erik Hesselink
a instance (NotAnInteger x) = Foo Bar x I haven’t declared integer to be “NotAnInteger”….so (in a closed world)….this would seem to exclude the contradiction….but… Functional dependencies conflict between instance declarations: instance Foo Integer Integer -- Defined at liam1.lhs:7:12

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

2013-07-05 Thread Tikhon Jelvis
”….so (in a closed world)….this would seem to exclude the contradiction….but… ** ** ** ** Functional dependencies conflict between instance declarations: instance Foo Integer Integer -- Defined at liam1.lhs:7:12 instance NotAnInteger x = Foo Bar x -- Defined at liam1

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

[Haskell-cafe] How to escape from typecheck error: Duplicate instance declarations ?

2013-01-25 Thread s9gf4ult
= Range2 unpack = unRange2 but there is compilation error: Duplicate instance declarations: instance [incoherent] (Num a, Ord a, Rangable range a, Packable range a) = SubtypeOf range a -- Defined at ...:22:10 instance

Re: [Haskell-cafe] How to escape from typecheck error: Duplicate instance declarations ?

2013-01-25 Thread Brandon Allbery
On Fri, Jan 25, 2013 at 3:18 PM, s9gf4...@gmail.com wrote: Duplicate instance declarations: instance [incoherent] (Num a, Ord a, Rangable range a, Packable range a) = SubtypeOf range a -- Defined at ...:22:10 instance [incoherent] (Integral a, Packable range a, MultipleTo range

Re: [Haskell-cafe] How to escape from typecheck error: Duplicate instance declarations ?

2013-01-25 Thread s9gf4ult
This has the code smell of trying to use typeclasses for OOP. That won't work. (Yes, really.) I am not trying to use OOP, I am just writing some typecasting at all. This would be correct. Constraints on an instance are applied *after* the instance is selected, so when Haskell is looking

Re: [Haskell-cafe] How to escape from typecheck error: Duplicate instance declarations ?

2013-01-25 Thread s9gf4ult
http://ideone.com/v2CrAm I has posted to ideone to show what is wrong.___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] How to escape from typecheck error: Duplicate instance declarations ?

2013-01-25 Thread Alexander Solla
On Fri, Jan 25, 2013 at 12:39 PM, s9gf4...@gmail.com wrote: ** This has the code smell of trying to use typeclasses for OOP. That won't work. (Yes, really.) I am not trying to use OOP, I am just writing some typecasting at all. This would be correct. Constraints on an instance

[Haskell-cafe] Explaining instance declarations

2012-07-29 Thread Patrick Browne
be at the same level or lower than the context of any instance of any super-class of C.  The purpose of this rule is to guarantee that the required super-class methods exist. [1] 4.3.2  Instance Declarations http://www.haskell.org/onlinereport/haskell2010/haskellch4.htmlClass hierarchy  Eq1   Show1

[Haskell-cafe] yi-editor: Duplicate instance declarations

2009-09-27 Thread Marcelo Sousa
) Yi/Prelude.hs:182:9: Duplicate instance declarations: instance Category Accessor.T -- Defined at Yi/Prelude.hs:182:9-38 instance Category Accessor.T -- Defined in data-accessor-0.2.1:Data.Accessor.Private cabal: Error: some packages failed to install: yi-0.6.1 failed during

Re: [Haskell-cafe] yi-editor: Duplicate instance declarations

2009-09-27 Thread Nicolas Pouillard
] ( Yi/Editor.hs-boot, dist/build/Yi/Editor.o-boot ) [ 18 of 120] Compiling Yi.Debug ( Yi/Debug.hs, dist/build/Yi/Debug.o ) [ 19 of 120] Compiling Yi.Prelude ( Yi/Prelude.hs, dist/build/Yi/Prelude.o ) Yi/Prelude.hs:182:9: Duplicate instance declarations: instance

Re: [Haskell-cafe] yi-editor: Duplicate instance declarations

2009-09-27 Thread Jochem Berndsen
Nicolas Pouillard wrote: Excerpts from Marcelo Sousa's message of Sun Sep 27 14:13:43 +0200 2009: Hey guys, I'm trying to install yi using cabal but I got this error. Any ideas how to solve it?! I'm using ghc-6.10.1 and cabal-install version 0.6.2 using version 1.6.0.2 of the Cabal library.

[Haskell-cafe] duplicate instance declarations. Why?

2008-10-24 Thread Alberto G. Corona
with: {-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-} class A a class R a class S a instance R a = A a instance S a = A a -- GHC gives *Duplicate instance declarations* * instance R a = A a * * instance S a = A a * ** *Why

Re: [Haskell-cafe] duplicate instance declarations. Why?

2008-10-24 Thread Bulat Ziganshin
Hello Alberto, Friday, October 24, 2008, 12:20:39 PM, you wrote: instance  R a = A a instance S a = A a   Duplicate instance declarations Why? because you may write in other module instance R Int instance S Int if class A includes functions, it may be problematic to determine which

Re: [Haskell-cafe] duplicate instance declarations. Why?

2008-10-24 Thread Ryan Ingram
Instance instantiation is *not* search, and *not* similar to subclassing in OO languages. Both your instance declarations simply add constraints to functions that use it. Here's a more concrete example: class A a where doA :: a - String class R a where doR :: a - String instance R Int

[Haskell-cafe] Re: Functional dependencies conflict between instance declarations

2007-09-12 Thread Stefan Monnier
Never mind, that GHC compiler was again more clever than me, sigh. That's really frustrating about Haskell: the compiler captures so many errors at compile time, that newbies hardly get anything done, it's a constant battle against the errors. But once it compiles, it usually works at runtime

RE: [Haskell-cafe] Re: Functional dependencies conflict between instance declarations

2007-09-12 Thread bf3
: Functional dependencies conflict between instance declarations Never mind, that GHC compiler was again more clever than me, sigh. That's really frustrating about Haskell: the compiler captures so many errors at compile time, that newbies hardly get anything done, it's a constant battle against

Re: [Haskell-cafe] Re: Functional dependencies conflict between instance declarations

2007-09-12 Thread Andrew Coppin
[EMAIL PROTECTED] wrote: Are you kidding, or has automatic proving of programs evolved that far? Aaarrrggg, soon we're all out of job ;-) Experts have been proclaiming this since high-level programming was invented many decades ago. We're still waiting. ;-)

[Haskell-cafe] Functional dependencies conflict between instance declarations

2007-09-10 Thread Peter Verswyvelen
The Haskell mailing list seems to be filled with people requesting information about this error, so I cannot resist to include myself in it ;-) I've read the information about funcdeps in the GHC user guide, and I think I understand how it works, but I get the error a lot, without having a

Re: [Haskell-cafe] Functional dependencies conflict between instance declarations

2007-09-10 Thread Peter Verswyvelen
Never mind, that GHC compiler was again more clever than me, sigh. That's really frustrating about Haskell: the compiler captures so many errors at compile time, that newbies hardly get anything done, it's a constant battle against the errors. But once it compiles, it usually works at runtime

Re: [Haskell-cafe] Functional dependencies conflict between instance declarations

2007-09-10 Thread Andrew Coppin
Peter Verswyvelen wrote: Never mind, that GHC compiler was again more clever than me, sigh. That's really frustrating about Haskell: the compiler captures so many errors at compile time, that newbies hardly get anything done, it's a constant battle against the errors. But once it compiles, it

[Haskell-cafe] Deferred instance declarations (context without type variables)

2006-09-16 Thread Misha Aizatulin
hello, I have a question about context in type signature. I would like to write a function, say (f :: T - T) which also relies on an instance of class C being defined for T. The problem is, I don't want this instance defined at the same time f is defined, instead I would like to defer this

[Haskell-cafe] technique to allow innocuous ambiguity in instance declarations?

2006-07-11 Thread Nicolas Frisby
in anyway. My question: Is there a technique to allow such innocuous ambiguity in instance declarations? I experimented with introducing something akin to a trace in a third parameter to the class which would disambiguate the derivation (by specifying the order of the transformations; reminded me

[Haskell-cafe] Re: technique to allow innocuous ambiguity in instance declarations?

2006-07-11 Thread oleg
Nicolas Frisby posed a problem about controlling the order of instance selection rules (or, the application of type improvement rules) Given the following code newtype IdL a = IdL a newtype IdR a = IdR a class C f g where nest :: f a - g a instance C IdL IdR where nest (IdL x) = IdR x

Re: [Haskell-cafe] Why distinct tyvars in instance declarations?

2005-06-27 Thread Frank-Andre Riess
Hi there, but GHC complains:     Illegal instance declaration for `Foo (Either b b)'         (The instance type must be of form (T a b c)          where T is not a synonym, and a,b,c are distinct type variables)     In the instance declaration for `Foo (Either b b)' unless I'm totally

Re: [Haskell-cafe] Why distinct tyvars in instance declarations?

2005-06-27 Thread robert dockins
but GHC complains: Illegal instance declaration for `Foo (Either b b)' (The instance type must be of form (T a b c) where T is not a synonym, and a,b,c are distinct type variables) In the instance declaration for `Foo (Either b b)' unless I'm totally mistaken, your

Re: [Haskell-cafe] Why distinct tyvars in instance declarations?

2005-06-26 Thread Daniel Fischer
Am Samstag, 25. Juni 2005 21:22 schrieb Josh Hoyt: Hello, I'm a new Haskeller, and I'm running into a problem attempting to declare certain types as instances. I was attempting something that's effectively equivalent to: class Foo a instance Foo (Either b b) but GHC complains:

Re: [Haskell-cafe] Why distinct tyvars in instance declarations?

2005-06-26 Thread Henning Thielemann
On Sun, 26 Jun 2005, Daniel Fischer wrote: Am Samstag, 25. Juni 2005 21:22 schrieb Josh Hoyt: Hello, I'm a new Haskeller, and I'm running into a problem attempting to declare certain types as instances. I was attempting something that's effectively equivalent to: class Foo a

[Haskell-cafe] Why distinct tyvars in instance declarations?

2005-06-25 Thread Josh Hoyt
Hello, I'm a new Haskeller, and I'm running into a problem attempting to declare certain types as instances. I was attempting something that's effectively equivalent to: class Foo a instance Foo (Either b b) but GHC complains: Illegal instance declaration for `Foo (Either b b)'

RE: instance declarations

2001-12-10 Thread Mark P Jones
Hi Marcin, | There's no solid technical reason for this, but Haskell doesn't allow | it at the moment because there isn't an easy way to name an instance | declaration. | | There is another problem: even if we created a syntax to name them, | if they would not be exported by default then

Re: instance declarations

2001-12-10 Thread Ketil Z Malde
sense for the class instance to be, too. (This leads to the question of why we need to have instance declarations at all :-) (My guesses would be: compiler implementation issues, code clarity, error detection, partially implemented classes)) Problems arise when a data type needs

Re: instance declarations

2001-12-09 Thread Marcin 'Qrczak' Kowalczyk
Fri, 7 Dec 2001 11:38:14 -0800, Mark P Jones [EMAIL PROTECTED] pisze: There's no solid technical reason for this, but Haskell doesn't allow it at the moment because there isn't an easy way to name an instance declaration. There is another problem: even if we created a syntax to name them, if

Re: instance declarations

2001-12-09 Thread David Feuer
Marcin 'Qrczak' Kowalczyk wrote: There is another problem: even if we created a syntax to name them, if they would not be exported by default then current programs would have to be changed. Well, the default could be to export, unless explicitly hidden. If it _is_ exported, you could have

Re: instance declarations

2001-12-07 Thread David Feuer
(sorry to mess up mail threading, but I couldn't properly reply to the message the way I'm using email right now--broken mail clients) Recently, however, there has been some interest in using named instance declarations in other ways, so perhaps we will see features like this creeping