ssadler / hawk

Awk for Hoodlums
BSD 3-Clause "New" or "Revised" License
35 stars 2 forks source link

auto-mempty #25

Open gelisam opened 11 years ago

gelisam commented 11 years ago

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.