[Haskell-beginners] How to improve performace of a dfs program