[Haskell-beginners] Foldable for (,)

Michael Orlitzky michael at orlitzky.com
Mon Apr 24 01:36:08 UTC 2017


On 04/23/2017 08:29 PM, Tony Morris wrote:
> A tuple doesn't only have one value. forall a. ((,) a) only has one
> value. Fortunately, Haskell has a kind system so we can easily determine
> what length does.

This all makes sense when you realize that Foldable is just the "Object" 
class from Visual Basic. There's only one sensible way to define a 
ToString() method on an arbitrary object; therefore it makes sense to 
provide that method by default, and to have it do the one thing it can 
do (print garbage).



More information about the Beginners mailing list