SQL aggregates are like fold functions | Hacker News Reader