Re: overlapping instances in 7.10.1

2015-06-16 Thread Sergei Meshveliani
) example illustrating of how overlapping instances (OI) are used in DoCon. Also this example is made after the sample that Simon has given in his recent letter: [..] 2) At least ghc-7.8.3 and ghc-7.10.1 do the same in this example. May be, you can change this example a bit to make ghc

RE: overlapping instances in 7.10.1

2015-06-15 Thread Sergei Meshveliani
) on ghc-7.8.3. But I need to understand the subject of overlapping instances (OI). -- I am writing this _here_ because to clicking at https://ghc.haskell.org/trac/ghc/ticket/10526 my browser responds Problem occurred while loading the URL https://ghc.haskell.org/trac/ghc

RE: overlapping instances in 7.10.1

2015-06-15 Thread Sergei Meshveliani
be resolved differently there. Now, I give a simple (and a very contrived) example illustrating of how overlapping instances (OI) are used in DoCon. Also this example is made after the sample that Simon has given in his recent letter: GHC generally assumes that if it generates (the instance) (C T

RE: overlapping instances in 7.10.1

2015-06-14 Thread Sergei Meshveliani
On Sat, 2015-06-13 at 23:07 +, Simon Peyton Jones wrote: (I reformat this text a bit) [..] I finally found time to look into what is happening here. It’s a good illustration of the dangers of overlapping instances. Here is the setup: * Module ResEuc_ * Contains instance

RE: overlapping instances in 7.10.1

2015-06-13 Thread Simon Peyton Jones
Sergei I finally found time to look into what is happening here. It's a good illustration of the dangers of overlapping instances. Here is the setup: * Module ResEuc_ * Contains instance (...)= Ring (ResidueE a) (A) instance (..., Ring

overlapping instances in 7.10.1

2015-05-23 Thread Sergei Meshveliani
Dear GHC developers, This request overrides my previous one of 7.10.1-err... (it is simpler and more precise). The archive http://www.botik.ru/pub/local/Mechveliani/ghcQuest/7.10.1-errReport-may23-2015.zip presents a question about ghc-7.10.1. Make it, please, with ghc-7.10.1 by

Re: overlapping instances 7.10.1

2015-05-21 Thread adam vogt
-XOverlappingInstances). Finally, it has come to this module: - Preprocessing library docon-2.12.1... [48 of 86] Compiling ResRing__ ( ResRing__.hs, dist/build/ResRing__.o ) ResRing__.hs:183:31: Overlapping instances for Eq (Maybe PropValue) arising

overlapping instances 7.10.1

2015-05-21 Thread Sergei Meshveliani
-XOverlappingInstances). Finally, it has come to this module: - Preprocessing library docon-2.12.1... [48 of 86] Compiling ResRing__ ( ResRing__.hs, dist/build/ResRing__.o ) ResRing__.hs:183:31: Overlapping instances for Eq (Maybe PropValue

overlapping instances in 7.10.1

2015-05-20 Thread Sergei Meshveliani
Dear GHC developers, Please, test ghc-7.10.1 on making docon-2.12 http://www.botik.ru/pub/local/Mechveliani/docon/ and running itsdemotest/Main (see install.txt). docon-2.12 has been tested under ghc-7.8.2, and it has extensions: ... OverlappingInstances in

Re: overlapping instances in 7.10.1

2015-05-20 Thread Sergei Meshveliani
Now, I delete `OverlappingInstances' from docon.cabal and also from the $doconCpOpt options to call ghc on demotest/Main.hs. And now the test runs correct in ghc-7.10.1 ! Only it is 1.5 times slower than in ghc-7.8.2. So: a) The test intends overlapping instances, b) instance

Re: overlapping instances in 7.10.1

2015-05-20 Thread Sumit Sahrawat, Maths Computing, IIT (BHU)
it is 1.5 times slower than in ghc-7.8.2. So: a) The test intends overlapping instances, b) instance overlaps are not declared for ghc-7.10.1, c) this leads to a correct running, but 1.5 times slower. I do not know of whether this slow down is due to the removed pragma or due to other

Re: [GHC] #7171: erroneous overlapping instances reported with FunDeps

2012-08-23 Thread GHC
#7171: erroneous overlapping instances reported with FunDeps -+-- Reporter: jwlato | Owner: Type: bug | Status: closed

Re: [GHC] #7171: erroneous overlapping instances reported with FunDeps

2012-08-23 Thread GHC
#7171: erroneous overlapping instances reported with FunDeps -+-- Reporter: jwlato | Owner: Type: bug | Status: closed

Re: [GHC] #7171: erroneous overlapping instances reported with FunDeps

2012-08-22 Thread GHC
#7171: erroneous overlapping instances reported with FunDeps -+-- Reporter: jwlato | Owner: Type: bug | Status: closed

Re: [GHC] #7171: erroneous overlapping instances reported with FunDeps

2012-08-22 Thread GHC
#7171: erroneous overlapping instances reported with FunDeps -+-- Reporter: jwlato | Owner: Type: bug | Status: new

Re: [GHC] #7171: erroneous overlapping instances reported with FunDeps

2012-08-22 Thread GHC
#7171: erroneous overlapping instances reported with FunDeps -+-- Reporter: jwlato | Owner: Type: bug | Status: new

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-22 Thread GHC
#7150: unjustified overlapping instances error +--- Reporter: maeder | Owner: Type: bug| Status: closed Priority: highest

Re: [GHC] #7171: erroneous overlapping instances reported with FunDeps

2012-08-21 Thread GHC
#7171: erroneous overlapping instances reported with FunDeps +--- Reporter: jwlato | Owner: Type: bug | Status: new

Re: [GHC] #7171: erroneous overlapping instances reported with FunDeps

2012-08-21 Thread GHC
#7171: erroneous overlapping instances reported with FunDeps -+-- Reporter: jwlato | Owner: Type: bug | Status: closed

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-21 Thread GHC
#7150: unjustified overlapping instances error +--- Reporter: maeder | Owner: Type: bug| Status: closed Priority: highest

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-21 Thread GHC
#7150: unjustified overlapping instances error +--- Reporter: maeder | Owner: Type: bug| Status: closed Priority: highest

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-21 Thread GHC
#7150: unjustified overlapping instances error +--- Reporter: maeder | Owner: Type: bug| Status: closed Priority: highest

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-21 Thread GHC
#7150: unjustified overlapping instances error +--- Reporter: maeder | Owner: Type: bug| Status: closed Priority: highest

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-21 Thread GHC
#7150: unjustified overlapping instances error +--- Reporter: maeder | Owner: Type: bug| Status: closed Priority: highest

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-21 Thread GHC
#7150: unjustified overlapping instances error +--- Reporter: maeder | Owner: Type: bug| Status: closed Priority: highest

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-21 Thread GHC
#7150: unjustified overlapping instances error +--- Reporter: maeder | Owner: Type: bug| Status: merge Priority: highest

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-21 Thread GHC
#7150: unjustified overlapping instances error +--- Reporter: maeder | Owner: Type: bug| Status: merge Priority: highest

Re: [GHC] #7171: erroneous overlapping instances reported with FunDeps

2012-08-21 Thread GHC
#7171: erroneous overlapping instances reported with FunDeps -+-- Reporter: jwlato | Owner: Type: bug | Status: closed

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-20 Thread GHC
#7150: unjustified overlapping instances error -+-- Reporter: maeder| Owner: Type: bug | Status: new Priority: highest | Milestone

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-20 Thread GHC
#7150: unjustified overlapping instances error -+-- Reporter: maeder| Owner: Type: bug | Status: new Priority: highest | Milestone

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-20 Thread GHC
#7150: unjustified overlapping instances error -+-- Reporter: maeder| Owner: Type: bug | Status: new Priority: highest | Milestone

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-20 Thread GHC
#7150: unjustified overlapping instances error -+-- Reporter: maeder| Owner: Type: bug | Status: new Priority: highest | Milestone

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-20 Thread GHC
#7150: unjustified overlapping instances error -+-- Reporter: maeder| Owner: Type: bug | Status: new Priority: highest | Milestone

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-20 Thread GHC
#7150: unjustified overlapping instances error -+-- Reporter: maeder| Owner: Type: bug | Status: new Priority: highest | Milestone

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-20 Thread GHC
#7150: unjustified overlapping instances error -+-- Reporter: maeder| Owner: Type: bug | Status: new Priority: highest | Milestone

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-20 Thread GHC
#7150: unjustified overlapping instances error -+-- Reporter: maeder| Owner: Type: bug | Status: new Priority: highest | Milestone

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-20 Thread GHC
#7150: unjustified overlapping instances error -+-- Reporter: maeder| Owner: Type: bug | Status: new Priority: highest | Milestone

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-20 Thread GHC
#7150: unjustified overlapping instances error -+-- Reporter: maeder| Owner: Type: bug | Status: new Priority: highest | Milestone

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-20 Thread GHC
#7150: unjustified overlapping instances error -+-- Reporter: maeder| Owner: Type: bug | Status: new Priority: highest | Milestone

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-20 Thread GHC
#7150: unjustified overlapping instances error +--- Reporter: maeder | Owner: Type: bug| Status: closed Priority: highest

[GHC] #7171: erroneous overlapping instances reported with FunDeps

2012-08-20 Thread GHC
#7171: erroneous overlapping instances reported with FunDeps ---+ Reporter: jwlato | Owner: Type: bug| Status: new

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-16 Thread GHC
#7150: unjustified overlapping instances error -+-- Reporter: maeder| Owner: Type: bug | Status: new Priority: normal| Milestone

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-16 Thread GHC
#7150: unjustified overlapping instances error -+-- Reporter: maeder| Owner: Type: bug | Status: new Priority: normal| Milestone

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-16 Thread GHC
#7150: unjustified overlapping instances error -+-- Reporter: maeder| Owner: Type: bug | Status: new Priority: normal| Milestone

[GHC] #7150: unjustified overlapping instances error

2012-08-15 Thread GHC
#7150: unjustified overlapping instances error ---+ Reporter: maeder | Owner: Type: bug| Status: new Priority: normal

Re: [GHC] #7150: unjustified overlapping instances error

2012-08-15 Thread GHC
#7150: unjustified overlapping instances error -+-- Reporter: maeder| Owner: Type: bug | Status: new Priority: normal| Milestone

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-06-09 Thread Gábor Lehel
On Tue, Jun 5, 2012 at 2:25 PM, Gábor Lehel illiss...@gmail.com wrote: The encoded version would be: instance (f a b) = FMap f (HJust a) (HJust b)  where type f :$: (HJust a) = HJust b and I think this actually demonstrates a *different* limitation, namely that The RHS of an associated

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-06-05 Thread Gábor Lehel
On Tue, Jun 5, 2012 at 4:18 AM, Etienne Laurin etie...@atnnn.com wrote: Thanks for the idea. Here it is. http://hackage.haskell.org/trac/ghc/wiki/TFvsFD I posted my comments on the matter along with many additional comments and examples that I found. Thanks! One part is confusing me. In

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-06-04 Thread Simon Peyton-Jones
| My take is that we should abandon Fundeps, and concentrate on | introducing overlaps into type functions in a controlled way (what | I've called 'dis- overlapped overlaps'.) | | Abandoning fundeps would be a sad day for type-level programming. | There are many things other than overlaps that

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-06-04 Thread AntC
Simon Peyton-Jones simonpj at microsoft.com writes: | My take is that we should abandon Fundeps, and concentrate on | introducing overlaps into type functions in a controlled way (what | I've called 'dis- overlapped overlaps'.) | | Abandoning fundeps would be a sad day for type-level

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-06-04 Thread Etienne Laurin
| Abandoning fundeps would be a sad day for type-level programming. | There are many things other than overlaps that you can do with fundeps | and constraint kinds that you cannot currently do with type families, | such as: | | - Partial application or higher-order programming. | -

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-06-01 Thread Iavor Diatchki
Hello, There is no problem if an instances uses a type family in it's assumption---the instances should be accepted only if GHC can see enough of the definition of the type family to ensure that the functional dependency holds. This is exactly the same as what it would do to check that a super

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-06-01 Thread Etienne Laurin
Hello, 2012/6/1 Iavor Diatchki iavor.diatc...@gmail.com: There is no problem if an instances uses a type family in it's assumption---the instances should be accepted only if GHC can see enough of the definition of the type family to ensure that the functional dependency holds.  This is

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-05-31 Thread Etienne Laurin
2012/5/31 Iavor Diatchki iavor.diatc...@gmail.com: Hello, the notion of a functional dependency is well established, and it was used well before it was introduced to Haskell (for example, take a look at http://en.wikipedia.org/wiki/Functional_dependency).  So I'd be weary to redefine it

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-05-31 Thread AntC
Iavor Diatchki iavor.diatchki at gmail.com writes: Hello, the notion of a functional dependency is well established, and it was used well before it was introduced to Haskell (for example, take a look at http://en.wikipedia.org/wiki/Functional_dependency).  So I'd be weary to redefine it

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-05-30 Thread Iavor Diatchki
if it was unsound for fundeps too. (I don’t think anyone has done a soundness proof for fundeps + local constraints + overlapping instances, have they?) And indeed I think it is. It would be unsound only if the functional dependencies are not checked properly (which, as you say, is similar

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-05-30 Thread Etienne Laurin
Hello, I disagree with your example. 1. Check that an instance is consistent with itself.  For example, this should be rejected: instance C a b because it allows C Int Bool and C Int Char which violate the functional dependency. Functional dependencies are not used to pick types, they

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-05-30 Thread Iavor Diatchki
Hello, the notion of a functional dependency is well established, and it was used well before it was introduced to Haskell (for example, take a look at http://en.wikipedia.org/wiki/Functional_dependency). So I'd be weary to redefine it lightly. Note that placing a functional dependency

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-05-28 Thread AntC
constraint.) Does the overall instance chain structure guarantee termination of type inference? I don't follow the algebra enough to be sure. Morris Jones' examples seem to me contrived: they've set up overlapping instances where you could avoid them, and even where they seem harder to follow. Yes

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-05-26 Thread AntC
Gábor Lehel illissius at gmail.com writes: On Fri, May 25, 2012 at 7:06 AM, AntC anthony_clayden at clear.net.nz wrote: But it looks like the work SPJ pointed to is using closed style. ... If you're referring to the NewAxioms work Simon linked to in the other thread, I don't see it

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-05-25 Thread Gábor Lehel
On Fri, May 25, 2012 at 7:06 AM, AntC anthony_clay...@clear.net.nz wrote: But it looks like the work SPJ pointed to is using closed style. If all they're trying to do is support HList and similar, I guess that's good enough. I tried to explain all this the best part of a year ago. (Admittedly

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-05-24 Thread AntC
Simon Peyton-Jones simonpj at microsoft.com writes: [from 7 Jul 2010. I've woken up this thread at Oleg's instigation http://www.haskell.org/pipermail/haskell-prime/2011-July/003491.html ] I'm not going to talk about Fundeps. This is about introducing overlapping instances into type

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-05-24 Thread Twan van Laarhoven
overlapping instances into type families. But I mean dis-overlapped overlaps, with dis- equality guards on the instances: http://www.haskell.org/pipermail/haskell-prime/2012-May/003689.html This is essentially the same proposal as the July 2011 discussion, but a little updated with actual experience of type

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-05-24 Thread AntC
Twan van Laarhoven twanvl at gmail.com writes: On 24/05/12 14:14, AntC wrote: Simon Peyton-Jonessimonpjat microsoft.com writes: Have you considered the alternative notation where multiple guards are allowed, as in normal function definitions? Something like: type instance F

Re: [Haskell-cafe] Quickcheck, Arbitrary and Overlapping instances

2011-09-22 Thread Valentin Robert
I think it is one case where you should use newtype instead of type, so that it is not just a simple type synonym, but an actual other type. With type, you're just making an alias, but Haskell sees the same type. A newtype wrapper will hide this, at the price of having to define a (unique)

Re: [Haskell-cafe] Problem on overlapping instances

2011-01-07 Thread Magicloud Magiclouds
I agree, but with a slight difference. Since I am so lazy, if Binary fits, like 80% of my requirements, for example this case, only [String] is not OK. I'd like to reuse it with a little modification made by myself, rather than re-write almost the whole of it. But for Data.Binary, I think this

Re: [Haskell-cafe] Problem on overlapping instances

2011-01-06 Thread Henning Thielemann
Magicloud Magiclouds schrieb: Hi, I am using Data.Binary which defined instance Binary a = Binary [a]. Now I need to define instance Binary [String] to make something special for string list. How to make it work? I looked into the chapter of overlappinginstances, nothing works.

Re: [Haskell-cafe] Problem on overlapping instances

2011-01-06 Thread Antoine Latter
Hello, I only use the 'Binary' class when I don't care about the specifics of the serialization format, only that it be reasonably fast, compact and stable. When I need to comply with some particular format I use the functions in Data.Binary.Builder and Data.Binary.Get directly. Sometimes I make

[Haskell-cafe] Problem on overlapping instances

2011-01-05 Thread Magicloud Magiclouds
Hi, I am using Data.Binary which defined instance Binary a = Binary [a]. Now I need to define instance Binary [String] to make something special for string list. How to make it work? I looked into the chapter of overlappinginstances, nothing works. -- 竹密岂妨流水过 山高哪阻野云飞

Re: [Haskell-cafe] Problem on overlapping instances

2011-01-05 Thread Steffen Schuldenzucker
Am 05.01.2011 09:24, schrieb Magicloud Magiclouds: Hi, I am using Data.Binary which defined instance Binary a = Binary [a]. Now I need to define instance Binary [String] to make something special for string list. How to make it work? I looked into the chapter of overlappinginstances,

Re: [Haskell-cafe] Problem on overlapping instances

2011-01-05 Thread Jasper Van der Jeugt
Hello, {-# LANGUAGE OverlappingInstances, FlexibleInstances #-} import Data.Binary instance Binary [String] where get = undefined put = undefined works fine here on GHC 6.12.3. That being said, it would be safer perhaps to add a newtype around [String] so you can

Re: [Haskell-cafe] Problem on overlapping instances

2011-01-05 Thread Luke Palmer
You can't. If you have special semantics for [String], then it is not really a [String], it is something else. So let the type system know that: newtype SomethingElse = SomethingElse [String] instance Binary SomethingElse where ... On Wed, Jan 5, 2011 at 1:24 AM, Magicloud Magiclouds

Re: [Haskell-cafe] Problem on overlapping instances

2011-01-05 Thread Stephen Tetley
You have two choices (other people have enumerated the first while I was typing): First choice: Wrap your Stringlist with a newtype: newtype StringList = StringList [String] The downside of this your code gets polluted with the newtype. Second choice: Write special putStringList and

Re: [Haskell-cafe] Problem on overlapping instances

2011-01-05 Thread Magicloud Magiclouds
Steffen Schuldenzucker: Sure. GHC would prompt that. Jasper Van der Jeugt: Not working with ghc7. But there sure are some threads about this kind of things. I do not know if this is a bug of 6.* or 7, either. Luke Palmer: Sorry, by special, I meant, for example, [a, b] will be ab by

Re: [GHC] #4259: Add overlapping instances for type families (was: Type family instance conflict checks could be smarter)

2010-08-19 Thread GHC
#4259: Add overlapping instances for type families +--- Reporter: lilac|Owner: Type: feature request | Status: new Priority: normal

Re: [GHC] #4259: Relax restrictions on type family instance overlap (was: Add overlapping instances for type families)

2010-08-19 Thread GHC
/6.12.1/html/users_guide/type- families.html user's guide] says: The instance declarations of a type family used in a single program may only overlap if the right-hand sides of the overlapping instances coincide for the overlapping types. More formally, two instance declarations overlap

[Haskell-cafe] Fundeps and overlapping instances

2010-07-07 Thread Simon Peyton-Jones
Oleg points out, and Martin also mentions, that functional dependencies appear to interact OK with overlapping instances, but type families do not. I this impression is mistaken, and I'll try to explain why in this message, in the hope of exposing any flaws in my reasoning. We can't permit

RE: Overlapping Instances + Existentials = Incoherent Instances

2010-02-10 Thread Simon Peyton-Jones
This is a tricky one. The motivating example is this: -- Overlapping instances instance Show a = Show [a] where ... instance Show Char where ... data T where MkT :: Show a = [a] - T f :: T - String f (MkT xs) = show xs ++ \n Here it's clear that the only way to discharge

Re: Overlapping Instances + Existentials = Incoherent Instances

2010-02-03 Thread Stefan Holdermans
to make use of the general versions of overlapping instances if any fit. I don't think it's the same thing. The whole point of the existential is that at the creation site of any value of type Ex the type of the value being packaged is hidden. At the use site, therefore, the only suitable

Re: Overlapping Instances + Existentials = Incoherent Instances

2010-02-03 Thread Dan Doel
On Wednesday 03 February 2010 11:34:27 am Stefan Holdermans wrote: I don't think it's the same thing. The whole point of the existential is that at the creation site of any value of type Ex the type of the value being packaged is hidden. At the use site, therefore, the only suitable instance

Overlapping Instances + Existentials = Incoherent Instances

2010-02-02 Thread Dan Doel
to make use of the general versions of overlapping instances if any fit. So, I never really regarded this as anything more than an oddity that's unlikely to come up. And it might be working as intended. But I thought perhaps I should ask: is this intended? One could probably build a case that baz

Re: [GHC] #565: overlapping instances fundeps broken

2009-11-18 Thread GHC
#565: overlapping instances fundeps broken --+- Reporter: ashley-y | Owner: simonpj Type: bug | Status: closed Priority: low

Re: [GHC] #565: overlapping instances fundeps broken

2009-11-17 Thread GHC
#565: overlapping instances fundeps broken --+- Reporter: ashley-y | Owner: Type: bug | Status: new Priority: low

Re: [GHC] #565: overlapping instances fundeps broken

2009-11-17 Thread GHC
#565: overlapping instances fundeps broken --+- Reporter: ashley-y | Owner: simonpj Type: bug | Status: new Priority: low

Re: [GHC] #565: overlapping instances fundeps broken

2009-07-17 Thread GHC
#565: overlapping instances fundeps broken +--- Reporter: ashley-y |Owner: Type: bug | Status: new Priority: low

[Haskell-cafe] Overlapping instances

2008-12-08 Thread John Ky
(version a) ++ , ++ users = % ++ show users ++ } When I run it however, I get this: *Main te - createEngine Hello 1 2 *Main s - tshow te interactive:1:5: Overlapping instances for TShow Engine arising from a use of `tshow' at interactive:1:5-12 Matching instances

Re: [Haskell-cafe] Overlapping instances

2008-12-08 Thread Ryan Ingram
On Mon, Dec 8, 2008 at 4:43 AM, Tobias Bexelius [EMAIL PROTECTED] wrote: {-# LANGUAGE OverlappingInstances #-} With this extension, the most specific instance will be used, i.e. instance TShow Engine for Engine's, no matter if it is an instance of Show. Of course, down this way madness lies

Re: Instrumenting overlapping instances

2008-10-27 Thread J. Garrett Morris
Hi, This is neat - but not quite what I was hoping for. My intended use was to build a number of packages and produce a listing of all overlapping instances, without knowing in advance which classes might contain overlap. This is why I was hoping to instrument GHC instead of using the existing

Instrumenting overlapping instances

2008-10-20 Thread J. Garrett Morris
Hello, I'm currently studying the use of overlapping instances, and I was hoping to instrument GHC to produce some variety of list of instances that overlapped. I haven't done any GHC hacking so far, so I'm not entirely familiar with the code base. Does anyone have any guidance on which modules

Re: Instrumenting overlapping instances

2008-10-20 Thread Claus Reinke
I'm currently studying the use of overlapping instances, and I was hoping to instrument GHC to produce some variety of list of instances that overlapped. I haven't done any GHC hacking so far, so I'm not entirely familiar with the code base. Does anyone have any guidance on which modules I

Overlapping instances vs. Haskell98 Report [was: How to disable warning for export item 'module ...' exports nothing?]

2008-08-15 Thread Sean Leather
= a module Main where import A import B import C main = do putStrLn $ a0= ++ show a0 putStrLn $ a1= ++ show a1 This works, because of the way the instances are used. While overlapping instances are imported into Main, they are not used in Main. Then that is a GHC bug

Re: Overlapping instances vs. Haskell98 Report [was: How to disable warning for export item 'module ...' exports nothing?]

2008-08-15 Thread Isaac Dupree
Sean Leather wrote: That's interesting. So, maybe there should be some language extension or warning (with associated -fno-warn) for this in GHC. Personally, I prefer the way it's done now. (I guess that's obvious, considering I'm developing a library that will take advantage of it. ;) ) But it

Re: [Haskell] A problem with overlapping instances and super-classes

2008-06-10 Thread Ian Lynagh
On Mon, Jun 09, 2008 at 09:21:02AM +0100, Simon Peyton-Jones wrote: This isn't great, but it's not really different than is the case for non-overlapping instances. Suppose module B1 declares 'instance C T', and uses that instance; and module B2 declares a *different* 'instance C T

Re: [Haskell] A problem with overlapping instances and super-classes

2008-06-10 Thread Claus Reinke
Yes indeed, this is one of those well-known (ie not at all well known, but folk lore) problems with overlapping instances, at least in programs where different instances can be in scope at different times. I think these examples are subtly different (eg, some trip up Hugs as well, some only GHC

RE: [Haskell] A problem with overlapping instances and super-classes

2008-06-09 Thread Simon Peyton-Jones
Yes indeed, this is one of those well-known (ie not at all well known, but folk lore) problems with overlapping instances, at least in programs where different instances can be in scope at different times. It's discussed (not very clearly) in http://www.haskell.org/ghc/docs/latest/html

Re: [Haskell] A problem with overlapping instances and super-classes

2008-06-09 Thread Claus Reinke
This isn't great, but it's not really different than is the case for non-overlapping instances. Suppose module B1 declares 'instance C T', and uses that instance; and module B2 declares a *different* 'instance C T', and uses that instance; and Main imports B1 and B2, but does not use either

[Haskell] A problem with overlapping instances and super-classes

2008-06-07 Thread Iavor Diatchki
Hello, (you should be able to copy and paste the code in this email into two modules called A and B to try it out) {-# LANGUAGE OverlappingInstances #-} module A where This module, together with module 'B', illustrates a problem in some implementations of overlapping instances

Re: [Haskell-cafe] ghc overlapping instances - solved

2007-12-06 Thread Steffen Mazanek
Hello, Isaac, this works for me. Thx a lot, Steffen 2007/12/5, Isaac Dupree [EMAIL PROTECTED]: Steffen Mazanek wrote: Hi, Stefan and Isaac, thx for providing quick advice. @Stefan: Unfortunately I have to use a list. @Isaac: I do not get it. Could you please provide a short

Re: [Haskell-cafe] ghc overlapping instances

2007-12-05 Thread Steffen Mazanek
is enough. I have tried -XOverlappingInstances, -XFlexibleInstances and also -XIncoherentInstances, however I still got an overlapping instances error for this declaration. You shouldn't use lists if you need to have special instance behavior - lists are for perfectly ordinary sequences of things

Re: [Haskell-cafe] ghc overlapping instances

2007-12-05 Thread Isaac Dupree
Steffen Mazanek wrote: Hi, Stefan and Isaac, thx for providing quick advice. @Stefan: Unfortunately I have to use a list. @Isaac: I do not get it. Could you please provide a short example of your approach? The question still remains. Which arguments do I have ghc to start with to get the same

  1   2   3   >