"Gets the job done in just a few hundred lines of easily-explained code" is a terrific standard to meet.
"Magic abstract Haskell-fu" cannot improve such a program very much.