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

Tony Morris tonymorris at gmail.com
Thu Apr 6 08:52:54 UTC 2017


Right, length is particularly unfortunate in that it is a bad example
for the purposes of parametricity. We can express additional properties,
as well as types, to make up for this shortcoming. Still better than
relying on glyphs, which are notoriously unreliable, misleading,
inefficient and impratical to use to convey useful information about the
behaviour of a function.

I will leave out the expression of these properties, so as not to rob
anyone of a fun and useful exercise. Ultimately, I genuinely do not
care. I routinely work on teams with people who do not care. We use
other tools for reasoning about programs; I argue, they are more
efficient and reliable. If anyone wants to disagree, that's fine, call
it pineapples or whatever may be chosen, and we can all move on. I
simply need that function, whatever it might be called.

PS: in a dream land, where hardware efficiencies are of no concern,
length = fmap (const ()).


On 06/04/17 18:12, Henrik Nilsson wrote:
> On 04/06/2017 04:15 AM, Tony Morris wrote:
>> By "length" here I mean, the function whose name is lima echo november
>> golf tango hotel. I truly do not care what it is called. Follow the
>> types, and the types of the types.
>
> I think the nub of the matter is that the types (and the types of the
> types) (in a language like Haskell) actually are not enough. There are
> (literally) infinitely many functions with the same type as "length".
> One might argue that few of those make "sense", but that is always
> going to be a precarious argument unless the setting is made clear.
>
> More generally, if we were to extrapolate and truly refer to things
> by their full specification, then that would be very cumbersome indeed.
> By analogy, mathematical theorems are full specifications, and they
> usually have names.
>
> Names matter, at least to most people (I dare guess), and in particular
> when we rely on the names to convey missing information, as is the
> case with "length" given its (Haskell) type.
>
> Best,
>
> /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.
>
> _______________________________________________
> 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/9b13883c/attachment-0001.sig>


More information about the Libraries mailing list