Fast imperative-style loops as a free monad EDSL in Haskell