It's a bit sad that #24 will fail if there are zero lines. Maybe we could detect whether the output type is an instance of Monoid, and start the fold with mempty if that is the case?
At the very least, we should detect (+) and (*) as a special case and start the fold at 0 and 1, respectively.
It's a bit sad that #24 will fail if there are zero lines. Maybe we could detect whether the output type is an instance of
Monoid
, and start thefold
with mempty if that is the case?At the very least, we should detect
(+)
and(*)
as a special case and start the fold at 0 and 1, respectively.