Partial sum implementation

What is clang-format doing here with a 1-character indent? It'd be nice if we could get the formatter to do something sane. I can just run it on the whole thing and be done.