Haskell: how to detect “lazy memory leaks”
问题 After few hours of debugging, I realized that a very simple toy example was not efficient due to a missing ! in an expression return $ 1 + x (thanks duplode!... but how come ghc does not optimize that??). I also realized it because I was comparing it with a Python code that was quicker, but I won't always write Python code to benchmark my code... So here is my question: is there a way to automatically detect these "lazy memory leaks", that slow down a program for no real reason? I'm still