Constraints on definition of `length` should be strengthened

Carter Schonwald carter.schonwald at gmail.com
Fri Apr 7 12:54:43 UTC 2017


Bifunctor and or new types for Swap / Flip style combinators seem to allow
roving parameters for functor. It's not pretty but it works.



On Thu, Apr 6, 2017 at 6:49 PM Nathan Bouscal <nbouscal at gmail.com> wrote:

> It *is* actually a useful instance and it is used in practice. It's not
> that better Haskell wouldn't have an biased pair type with these instances,
> it's that it would *also* have an unbiased one with the instances that such
> a type could support. The issue seems to be that people don't like the
> biased type having special syntax that wrongly gives an unknowing reader
> the impression that the type is unbiased. This is a reasonable position,
> but getting rid of the tuple instances isn't a reasonable way to act on
> that position: 1) they're going to be defined anyway, but also 2) it's not
> helpful to just pretend the type is unbiased when it isn't. It would be
> coherent to argue for the removal of the special tuple syntax (though
> coherent doesn't mean reasonable; this would break everything), but it's
> not coherent to argue for crippling tuples so we can pretend they're
> something they aren't.
>
>
> On Thu, Apr 6, 2017 at 11:17 AM <amindfv at gmail.com> wrote:
>
>
>
> > 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
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20170407/4470657b/attachment.html>


More information about the Libraries mailing list