Competitive programming in Haskell: prefix sums Posted on June 27, 2025 Tagged monoid , range , query , prefix , sum , Haskell , competitive programming Share on In a previous blog post I categorized a number of different techniques for calculating range queries . Today, I will discuss one of those techniques which is simple but frequently useful. Precomputing prefix sums Suppose we have a static…