[Haskell-beginners] foldr with short circuit and accumulator