Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That doesn’t sound like the correct reading to me, because foldMap and foldl/foldr have different type signatures

https://www.stackage.org/haddock/lts-15.4/base-4.13.0.0/Prel...



Yeah, but they solve basically the same problem.

As I mentioned, foldMap requires associativity. Per your link I guess it also requires existence of a neutral element (whereas foldr instead makes you specify a starting element).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: