[Haskell-beginners] Foldable for (,)

Doug McIlroy doug at cs.dartmouth.edu
Sun Apr 23 14:47:31 UTC 2017


> So to go back to your examples:
>
>     (2,3)
>      ^ ^
>      | +------------- I am the value
>      |
>      +--------------- I am an annotation (and since tuples arguments can
>                       be heterogeneous, I could be a String, a Bool,
>                       anything).
>
> If you agree with this paradigm, `length`, `sum` and friend become a
> bit less icky.

To me, "annotation" connotes auxiliary information--yet it will
be the primary key when pairs are sorted. I would be more
comfortable with the explanation if the field were referred
to as an "identifier", or some similar term.

Doug


More information about the Beginners mailing list