Functor, Applicative, Monad, Foldable, Traversable instances for (, , ) a b

Tony Morris tonymorris at gmail.com
Thu Apr 6 07:53:59 UTC 2017


I don't think it is the "appropriate" set. It's an example. 0 is in the
set of integers. The value 0 is in many sets. ((,) a) is the set of
things which are Foldable, and consequently, have a length, which
reasoning by the type and kind system, immediately leads to the
conclusion that it is (very obviously) 1. I am deliberately picking on
the argument, "from obviousness", which is the best counter-argument so
far (according to the counter-arguers; hoping not to misrepresent here).
This is not only a weak argument, I hope we can agree, but *the exact
opposite* is true, where we probably disagree.

Our premises:

  Foldable :: (* -> *) -> Constraint
  length :: forall f. * -> *. f a -> Int
  let length = foldl (+) 0 -- or similar
  let f ~ ((,) a)

Anything but length=1 for not only not "obvious", but I argue completely
ridiculous, by the definition of length. I am not fond of the "argument
from obviousness", but if I am forced to use it, I will, and any
counter-argument will still fail.

PS: I didn't see your original question, sorry. I just stopped looking
at the thread for a bit.


On 06/04/17 17:28, Jon Fairbairn wrote:
> Tony Morris <tonymorris at gmail.com> writes:
>
>> I did read it. I chose not to respond. I do not believe it to be a
>> constructive avenue.
>>
>> I am repeating myself far less than the misunderstanding and
>> inconsistency around "tuples." To this end, I believe is worthwhile to
>> continue pointing out the inconsistency, and only slightly less so than
>> those who hold a contrary inconsistent position, who are inadvertently
>> pointing out the inconsistency. 0 is not an integer is a statement of
>> equal validity, buit more obviously not so.
> You keep using “integer”, but didn’t answer my question. What
> makes you think that integer is the appropriate set? What do the
> negative numbers represent in this context? If the answer is
> “nothing”, you are actually talking about natural numbers, and
> both the sets ℕ and ℕ⁺ are perfectly respectable.
>
>> The length of ((,) a) is exactly one. Anything else is
>> ridiculous.
> So that I can understand this, please give an example of a
> programme where this usage is meaningful.
>
>   — Jón
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20170406/9720cc1b/attachment.sig>


More information about the Libraries mailing list