This should be considerably faster than the older Haskell-based code, and far less prone to inliner space explosions.