Haskell Space Leak
问题 all. While trying to solve some programming quiz: https://www.hackerrank.com/challenges/missing-numbers , I came across with space leak. Main function is difference , which implements multi-set difference. I've found out that List ':' and Triples (,,) kept on heaps with -hT option profiling. However, only big lists are difference 's two arguments, and it shrinks as difference keeps on tail recursion. But the memory consumed by lists keeps increasing as program runs. Triples is ephemeral array