News for hackers. Stuff that matters.
Re:Anecdotally, Programmers Dislike "Reduce" by pash on Thursday September 17, 2026 @12:14AM (#49736324)
In other words, look at the types. The type of the folding function (the first argument) indicates how each fold works.

  foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b

  foldr  :: Foldable t => (a -> b -> b) -> b -> t a -> b
Re:Anecdotally, Programmers Dislike "Reduce" by internet_points on Thursday September 17, 2026 @03:18AM (#49737489)
That's what I tend to do, but since foldr/foldl' is so ubiquitous in Haskell it would be nice if I could just remember the argument order of the callback. kccqzy's explanation (in particular "it replaces the comma") might just help me do that :)