Constraints on definition of `length` should be strengthened

amindfv at gmail.com amindfv at gmail.com
Thu Apr 6 19:18:35 UTC 2017



> El 6 abr 2017, a las 08:52, Ivan Lazar Miljenovic <ivan.miljenovic at gmail.com> escribió:
> 
>> On 6 April 2017 at 23:56,  <amindfv at gmail.com> wrote:
>> I don't totally understand this viewpoint. It sounds like what you're saying
>> is it's unfortunate that tuples (and everything else) are biased in Haskell,
>> but because they are we're obligated to make all the legal instances we can
>> for them.
>> 
>> E.g. if I define a datatype "data Foo x y z", I'm powerless and sort of
>> obligated to define "instance Functor (Foo x y)" if there's a legal one,
>> regardless of if that's what I want Foo to mean.
> 
> Is Foo going to be widely used or only an internal data type to your own code?
> 

For the sake of comparison, let's say it's going to be widely used. It's also a structure which isn't (conceptually) biased.

If we're starting from a place of feeling that it's a shame Haskell is unable to have unbiased structures, then probably an "if we knew then what we know now" version of Haskell would have them. So then why knowingly create instances we think a "better Haskell" wouldn't have?

Is the argument that if it's public-facing, someone's going to define the instance and so we should do it canonically? If so, this feels to me a little like "you can't fire me, I quit!" - doing what we don't want before someone else has a chance to.

Tom


>> 
>> Tom
>> 
>> 
>> El 3 abr 2017, a las 15:29, Nathan Bouscal <nbouscal at gmail.com> escribió:
>> 
>> I expect most people probably agree that it'd be nice to have tuples be an
>> unbiased cartesian product, but the actual fact of the matter is that tuples
>> as they exist in Haskell are biased. We can't just ignore that and pretend
>> they're unbiased. It definitely sucks that the answer people would naively
>> give to "what is a tuple in Haskell" is not the correct answer, but we're
>> stuck in that situation. The question is how to make the best of it.
>> 
>> On Mon, Apr 3, 2017 at 12:56 PM, Henning Thielemann
>> <lemming at henning-thielemann.de> wrote:
>>> 
>>> 
>>>> On Mon, 3 Apr 2017, Sven Panne wrote:
>>>> 
>>>> Of course such an interpretation is possible, but let's remember
>>>> Abelson's famous quote:
>>>> 
>>>>   "Programs must be written for people to read, and only incidentally
>>>> for machines to execute."
>>>> 
>>>> When you show somebody a pair and ask "What is this?", how many people do
>>>> you *seriously* expect to say "Oh, yeah, I've seen that: It's a value on the
>>>> right decorated by another one on the left!" compared to people telling you
>>>> something about e.g. cartesian products (which are totally symmetric with no
>>>> bias to the right or left)? The point is: Using a pair for a decorated
>>>> one-element container is completely miscommunicating your intent, even if
>>>> you find a sensible mathematical interpretation for it.
>>> 
>>> 
>>> That's what I am saying all the time.
>>> _______________________________________________
>>> Libraries mailing list
>>> Libraries at haskell.org
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>> 
>> _______________________________________________
>> Libraries mailing list
>> Libraries at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>> 
>> 
>> _______________________________________________
>> Libraries mailing list
>> Libraries at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
> 
> 
> 
> -- 
> Ivan Lazar Miljenovic
> Ivan.Miljenovic at gmail.com
> http://IvanMiljenovic.wordpress.com


More information about the Libraries mailing list