Fwd: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-06-12 Thread Carlos Camarao
I forgot to cc the message below to haskell-cafe... -- Forwarded message -- From: Carlos Camarao Date: Thu, Jun 10, 2010 at 4:40 PM Subject: Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma To: "Brandon S. Allbery KF8NH" On Wed, Jun 9, 2010 at 1:5

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-06-08 Thread Brandon S. Allbery KF8NH
On Jun 8, 2010, at 15:32 , Job Vranish wrote: It seems like this would make working with MPTCs much easier. When programming, I generally want to only specify the minimum amount of information to make my code logically unambiguous. If the code contains enough information to infer the proper i

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-06-08 Thread Job Vranish
Sorry for reopening an old thread, but I thought I'd counter some of the negative feedback :) I think this proposal is a great idea! It seems like this would make working with MPTCs much easier. When programming, I generally want to only specify the minimum amount of information to make my code

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-28 Thread Carlos Camarao
On Wed, May 26, 2010 at 7:12 PM, Max Bolingbroke wrote: > I broadly agree, but pragmatically the notion of orphans is useful for > designing robust libraries, even if the notion is a bit horrible. ... > I guess that a MPTC instance (C t1 .. tn) for class C in module M1 is NOT an > orphan if: 1)

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-26 Thread Max Bolingbroke
Hi Carlos, Apologies for the lateness of my reply. On 23 May 2010 02:24, Carlos Camarao wrote: > I think that a notion of orphan instances based on whether an > instance is defined or not in the module where the class of the > instance is defined is not very nice I broadly agree, but pragmatica

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-23 Thread Carlos Camarao
Sorry to correct myself: On Sat, May 22, 2010 at 10:24 PM, Carlos Camarao wrote: > ... > = > PS: I think that a definition of orphan/non-orphan instance definition > for MPTCs should be different. > Letting: ... > instance-de

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-22 Thread Carlos Camarao
On 21 May 2010 01:58, Carlos Camarao wrote: >> But this type-correct program would become not typeable if >> instances such as the ones referred to before (by Daniel Fischer) ... > It seems that single param type classes enjoy a nice property: ... > * Adding an instance to the module defining t

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-21 Thread David Menendez
On Fri, May 21, 2010 at 3:56 AM, Max Bolingbroke wrote: > On 21 May 2010 01:58, Carlos Camarao wrote: >> But this type-correct program would become not typeable if >> instances such as the ones referred to before (by Daniel Fischer) > > I was thinking this through, and the situation is more compl

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-21 Thread Marco Túlio Gontijo e Silva
Hi Max. Excerpts from Max Bolingbroke's message of Sex Mai 21 04:56:51 -0300 2010: (...) > (Incidentally, the link to your paper is broken, so I haven't actually > been able to read it, sorry!) It was easy to find it on google. http://www.dcc.ufmg.br/~camarao/CT/solution-to-mptc-dilemma.pdf Gre

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-21 Thread Max Bolingbroke
On 21 May 2010 01:58, Carlos Camarao wrote: > But this type-correct program would become not typeable if > instances such as the ones referred to before (by Daniel Fischer) I was thinking this through, and the situation is more complex than I had thought. It seems that single param type classes

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-21 Thread Stephen Tetley
Hi Evan EHC - Essential Haskell Compiler - is the 'family of compilers' that UHC - Utrecht Haskell Compiler - is instance one of. The EHC family starts with a simple Haskell subset and adds features building up to (almost) Haskell98 for UHC and extended Haskell for some of the EHC variations. This

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-20 Thread Evan Laforge
> Hi Evan, hasn't EHC had something like this for a while with 'type > class directives'? I dunno, I don't even know what ehc is. Is it this? http://www.cs.uu.nl/wiki/Ehc/WebHome I turned up a paper that mentioned type class directives, but I haven't read it yet. In any case, the EHC page says

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-20 Thread Carlos Camarao
On Thu, May 20, 2010 at 7:54 PM, Max Bolingbroke < batterseapo...@hotmail.com> wrote: > On 20 May 2010 20:30, Carlos Camarao wrote: > > > ... Also, the same fragilty occurs if FDs are used. > > This remark is surprising to me. I thought the point of the FDs being > declared on the original cla

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-20 Thread Max Bolingbroke
On 20 May 2010 20:30, Carlos Camarao wrote: > Consider instances defined in non-imported modules to be visible in the > current > context is not correct, I think... I was under the impression that this was not specified, because orphans are a bit of an oddity. But naturally the Haskell spec says

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-20 Thread Stephen Tetley
On 20 May 2010 21:16, Evan Laforge wrote: > Someone recently described the HASP project, at > http://hasp.cs.pdx.edu/.  It describes "habit", a haskell like > language with some additions and subtractions.  There are a couple > interesting extensions to 'instance' declarations: > > -- explicitly

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-20 Thread Evan Laforge
> I wonder: Of cases where overload resolution via available instances > would be reasonable, how many would also make sense as a closed type > class? By comparison, it seems that many uses of OverlappingInstances > are really just trying to express a closed type class with one or more > default in

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-20 Thread Carlos Camarao
On Thu, May 20, 2010 at 1:25 PM, Max Bolingbroke wrote: > On 20 May 2010 16:50, Carlos Camarao wrote: > >> Using the available instances to resolve overloading is a tricky thing, > >> it's very easy to make things break that way. > > > > Using the available instances is the natural, in fact the

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-20 Thread C. McCann
On Thu, May 20, 2010 at 12:25 PM, Max Bolingbroke wrote: > "Available instances" are not a natural addition to this list. In > particular, using that information can cause programs to become > untypeable when the module or *any module it imports transitively* > defines a new instance. This leads t

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-20 Thread Max Bolingbroke
On 20 May 2010 16:50, Carlos Camarao wrote: >> Using the available instances to resolve overloading is a tricky thing, >> it's very easy to make things break that way. > > Using the available instances is the natural, in fact the only way, to > resolve overloading. AFAIK no other Haskell feature

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-20 Thread Carlos Camarao
On Thu, May 20, 2010 at 11:54 AM, Daniel Fischer wrote: > > On Thursday 20 May 2010 16:34:17, Carlos Camarao wrote: > > In the context of MPTCs, this rule alone is not enough. Consider, for > > example (Example 1): > > > >class F a b where f:: a->b > >class O a where o:: a > > and > >

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-20 Thread Daniel Fischer
On Thursday 20 May 2010 16:34:17, Carlos Camarao wrote: > In the context of MPTCs, this rule alone is not enough. Consider, for > example (Example 1): > >    class F a b where f:: a->b >    class O a where o:: a > and >     k = f o:: (C a b,O a) => b > > Type forall a b. (C a b,O a) => b can be con

[Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-20 Thread Carlos Camarao
This message presents, informally, a proposal to solve Haskell's MPTC (multi-parameter type class) dilemma. If this informal proposal turns out to be acceptable, we (I am a volunteer) can proceed and make a concrete proposal. The proposal has been published in the SBLP'2009 proceedings and is avai