Constraints on definition of `length` should be strengthened

Vladislav Zavialov vlad.z.4096 at gmail.com
Tue Apr 4 06:15:29 UTC 2017


> Tuples are unbiased cartesian products, full stop.

This statement is not correct. Look at their kind:

> :k (,)
(,) :: * -> * -> *

The same currying business is going on here. One of the types is
privileged. To get unbiased products in Haskell, you need their kind
to be [*] -> * or similar.

On Tue, Apr 4, 2017 at 9:11 AM, Sven Panne <svenpanne at gmail.com> wrote:
> 2017-04-03 23:14 GMT+02:00 Nathan Bouscal <nbouscal at gmail.com>:
>>
>> On Mon, Apr 3, 2017 at 1:48 PM, Sven Panne <svenpanne at gmail.com> wrote:
>>>
>>> Tuples *are* unbiased, the bias is just an artifact of seeing them as a
>>> curried function, where the positions are "eaten" from left to right. Again,
>>> this mathematically correct, but more often than not the main intent of
>>> using a tuple-
>>>
>>
>>
>> … no, they're not. What other type of correct is there than mathematically
>> correct? "Zero isn't an integer, that's just an artifact of *seeing* it as
>> an integer."
>
>
> Tuples are unbiased cartesian products, full stop. All the left bias is
> coming from currying. If you have a signature of e.g.:
>
>    fobar :: Int -> (a, b) -> Float -> Bar
>
> I can't see any bias here. OTOH:
>
>    fobar' :: Int -> a -> b -> Float -> Bar
>
> Now you have a left bias, because you can partially apply foobar' with e.g.
> 2 arguments, "eating away" the 'a', but keeping the 'b'.
>
>
>>
>> You can't get tuples to behave like they're unbiased. You can try to hide
>> the fact that they're biased by getting rid of the only possible instances
>> they can support, but that doesn't magically make them unbiased.
>
>
> Again, tuples are unbiased, you just put an interpretation onto them which
> is induced by currying, but which is not the intuitive one. I want to get
> rid of that interpretation as the default one, because that's a
> miscommunication of intents (see previous post).
>
>>
>> It sounds like you just want to rename tuples to Decorated. Maybe that's a
>> good idea, but call it what it is.
>
>
> Nope, my proposal is: Keep tuples what they are (unbiased heterogenous
> collections) and make any bias explicit (Decorated).
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>


More information about the Libraries mailing list