Overlapping and incoherent instances

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Wed Jul 30 12:50:32 UTC 2014


On 30 July 2014 22:07, Andreas Abel <andreas.abel at ifi.lmu.de> wrote:
> Iavor,
>
> I am a bit surprised by the distinction you outline below.  This is maybe
> because I am native German, not English.  The German equivalent of
> "overlap", "überschneiden/überlappen", is used exclusively in a symmetrical
> fashion.  It's like in English, if I say "our interests overlap", then it is
> pointless to ask whether my interest are overlapping yours or are overlapped
> by yours.  I want to alert you to the fact that non-native English speaker
> might have little understanding for a distinction between "OVERLAPPING" and
> "OVERLAPPABLE".
>
> Let's try to guess what it meant:  Given
>
> A) instance Bla Char
> B) instance Bla a => Bla [a]
> C) instance Bla String
>
> you will in context A,B write C as OVERLAPPING,
> and in context A,C write B as OVERLAPPABLE?

IIUC, B will be OVERLAPPABLE ("you can overlap this") and C will be
OVERLAPPING ("I'm overlapping an existing one") whereas C will be
plain.

>
> Is this correct?
>
> Is it important to distinguish between OVERLAPPING and OVERLAPPABLE?  Why?
>
> -- Andreas
>
>
> On 29.07.2014 19:28, Iavor Diatchki wrote:
>>
>> Hello,
>>
>> I have no strong feelings about what words we use, but I wanted to point
>> out that while we are thinking of names, we may want to consider 3 (and
>> not just 2).  Currently we have:
>>    * OVERLAPPING:   This instances may overlap existing instances
>>    * OVERLAPPABLE: This instance may be overlapped by existing instances
>>    * OVERLAPS:  This instance is both OVERLAPPING and OVERLAPPABLE
>>
>> Of course, the 3rd one (OVERLAPS) could be replaced by a comma separated
>> list of the first two, but I could not see how to make this work easily
>> with GHC's pragmas.  It would not be hard to simply allow 2 pragmas
>> after the `instance` keyword, but both of those seem rather long.
>>
>> Either way, I'll keep an eye on the discussion, and would be happy to
>> change the names if a consesus is reached.
>>
>> -Iavor
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On Tue, Jul 29, 2014 at 9:57 AM, David Thomas <davidleothomas at gmail.com
>> <mailto:davidleothomas at gmail.com>> wrote:
>>
>>     Honestly, I think "OVERLAPS" and "OVERLAPPED" are perfectly clear.
>>
>>     On Tue, Jul 29, 2014 at 9:52 AM, David Feuer <david.feuer at gmail.com
>>     <mailto:david.feuer at gmail.com>> wrote:
>>      > CAN-OVERLAP and CAN-BE-OVERLAPPED are nice and clear. A little
>>     long, perhaps.
>>      >
>>      > On Tue, Jul 29, 2014 at 12:29 PM, Simon Peyton Jones
>>      > <simonpj at microsoft.com <mailto:simonpj at microsoft.com>> wrote:
>>      >> CAN_OVERLAP and CAN_BE_OVERLAPPED?
>>      >>
>>      >>
>>      >>
>>      >> (instead of OVERLAPPING and OVERLAPPABLE)
>>      >>
>>      >>
>>      >>
>>      >> Or CAN-OVERLAP, CAN-BE-OVERLAPPED
>>      >>
>>      >>
>>      >>
>>      >> That’s ok with me if that’s what you all want!
>>      >>
>>      >>
>>      >>
>>      >> Simon
>>      >>
>>      >>
>>      >>
>>      >> From: Glasgow-haskell-users
>>      >> [mailto:glasgow-haskell-users-bounces at haskell.org
>>     <mailto:glasgow-haskell-users-bounces at haskell.org>] On Behalf Of
>>     Krzysztof
>>      >> Skrzetnicki
>>      >> Sent: 29 July 2014 16:56
>>      >> To: Brandon Allbery
>>      >> Cc: Simon Peyton Jones; Andreas Abel; GHC users; Haskell Libraries
>>      >> (libraries at haskell.org <mailto:libraries at haskell.org>); ghc-devs
>>
>>      >>
>>      >>
>>      >> Subject: Re: Overlapping and incoherent instances
>>      >>
>>      >>
>>      >>
>>      >> How about CAN_OVERLAP?
>>      >>
>>      >> --
>>      >> Krzysztof
>>      >>
>>      >> 29-07-2014 15:40, "Brandon Allbery" <allbery.b at gmail.com
>>     <mailto:allbery.b at gmail.com>> napisał(a):
>>
>>      >>
>>      >> On Tue, Jul 29, 2014 at 8:33 AM, Andreas Abel
>>     <andreas.abel at ifi.lmu.de <mailto:andreas.abel at ifi.lmu.de>>
>>
>>      >> wrote:
>>      >>
>>      >> +1. I like Niklas' syntax better.  Also OVERLAPPABLE is a
>>     horrible word,
>>      >> OVERLAPPING sound less formidable (even though it might be
>>     slightly less
>>      >> accurrate).
>>      >>
>>      >>
>>      >>
>>      >> We already get "overlap ok" in instance-related type errors, so
>>     OVERLAP_OK
>>      >> wouldn't be particularly alien even if it doesn't quite fit in
>>     with existing
>>      >> pragmas.
>>      >>
>>      >>
>>      >>
>>      >> --
>>      >>
>>      >> brandon s allbery kf8nh                               sine
>>     nomine associates
>>      >>
>>      >> allbery.b at gmail.com <mailto:allbery.b at gmail.com>
>>     ballbery at sinenomine.net <mailto:ballbery at sinenomine.net>
>>
>>      >>
>>      >> unix, openafs, kerberos, infrastructure, xmonad
>>     http://sinenomine.net
>>      >>
>>      >>
>>      >> _______________________________________________
>>      >> Libraries mailing list
>>      >> Libraries at haskell.org <mailto:Libraries at haskell.org>
>>
>>      >> http://www.haskell.org/mailman/listinfo/libraries
>>      >>
>>      >>
>>      >> _______________________________________________
>>      >> Libraries mailing list
>>      >> Libraries at haskell.org <mailto:Libraries at haskell.org>
>>
>>      >> http://www.haskell.org/mailman/listinfo/libraries
>>      >>
>>      > _______________________________________________
>>      > Libraries mailing list
>>      > Libraries at haskell.org <mailto:Libraries at haskell.org>
>>
>>      > http://www.haskell.org/mailman/listinfo/libraries
>>     _______________________________________________
>>     Libraries mailing list
>>     Libraries at haskell.org <mailto:Libraries at haskell.org>
>>
>>     http://www.haskell.org/mailman/listinfo/libraries
>>
>>
>>
>>
>> _______________________________________________
>> Libraries mailing list
>> Libraries at haskell.org
>> http://www.haskell.org/mailman/listinfo/libraries
>>
>
>
> --
> Andreas Abel  <><      Du bist der geliebte Mensch.
>
> Department of Computer Science and Engineering
> Chalmers and Gothenburg University, Sweden
>
> andreas.abel at gu.se
> http://www2.tcs.ifi.lmu.de/~abel/
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries



-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
http://IvanMiljenovic.wordpress.com


More information about the Libraries mailing list