> On Sun Apr 9 19:24:12 UTC 2017, Sven Panne wrote:
>> 2017-04-09 2:01 GMT+02:00 Ben Franksen :
>>> Am 08.04.2017 um 04:03 schrieb Anthony Clayden:
>>> [...] So to take your examples from an earlier thread,
>>> what do you expect Haskell to do here?:
>>> maximum (True,2) => ?
>>> minimum ((3, 4),5) => ? -- i.e. :: ((Int, Int),
>>> sum (7,3.14) => ? -- i.e. :: (Int, Double)
>>> product (Left $ error "Errk") => ? -- i.e. ::
>>> Either e
>> I (and others) think these should be type errors.
OK. Do y'all think there should be a `toList` method for
Indeed, should there be a `toList` method available
for any data type that doesn't implement `fromList`?
Perhaps `toList` should not be a method of Foldable?
>>> Do you expect Foldable (a, a) to behave differently
>>> vs Foldable (b, a) vs Foldable ((a, a), a) vs ...?
>> It would be nice if we could all agree on removing these
> Yep. :-)
>> BTW, I find it remarkable that of those who defend these
>> seem to be especially interested in clarifying the OP's
>> laws exactly do we expect for Foldable? [...]
One of the Laws appears to be that `length` etc
behave as `length . toList`.