Haskell Foldable Wast

Jeremy voldermort at hotmail.com
Sun Feb 21 08:44:48 UTC 2016


Let us consider some of the functions that Foldable actually provides for
tuples:

length
Useless and wrong. Unless "length" means "the number of items which fmap
will operate over", in which case it's just useless and misleading.

maximum
Useless and wrong/misleading.

minimum
Useless and wrong/misleading.

product
Useless and wrong/misleading.

sum
Useless and wrong/misleading.

etc

It may be that some of the Foldable methods for tuples happen to be useful,
but this does not mean that tuples are foldable. It means that there are
some potentially useful helper methods which could be defined for tuples,
and included in the Prelude. It may be that the same methods are applicable
to Either, in which case there could be a new class
ApplyFunctionToArbitraryPreDeterminedComponent. It may even make sense for
this class to be a super-class of Foldable. But it does not make sense for
tuples or Either to be instances of Foldable, because they aren't foldable.



--
View this message in context: http://haskell.1045720.n5.nabble.com/Proposal-Add-conspicuously-missing-Functor-instances-for-tuples-tp5827530p5830705.html
Sent from the Haskell - Libraries mailing list archive at Nabble.com.


More information about the Libraries mailing list