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

Henrik Nilsson Henrik.Nilsson at nottingham.ac.uk
Sat Apr 1 08:42:24 UTC 2017


Hi all,

 > It is perfectly to limit the concept of "length" to
 >
 > * linear structures (lists, arrays, etc.)
 >   [branching structures do not have a length, they may have a size or
 >   maximum depth]
 >
 > * which have variable length
 >   [why would you otherwise ask for the length?]

Just for the record, I could not agree more.

Looking up "length", e.g. Merriam-Webster:

     1a :  the longer or longest dimension of an object

What we really are talking about here is counting the number of
elements in a data structure. That is clearly applicable to lists
as well as trees and tuples interpreted in particular ways.

But calling it "length" is not particularly helpful. Nor the effort to
reappropriate the very concept of "length" through a categorical
interpretation.

It would have been a lot better if a name suggesting a sense of
counting, or at least a name suggesting that this is something different
than the usual length, would have been picked. Maybe elementcount
or ever flength.

Names matter.

/Henrik




This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it. 

Please do not use, copy or disclose the information contained in this
message or in any attachment.  Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.

This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.



More information about the Libraries mailing list