title: Forcing Strict Evaluation - What am I doing wrong?
body: <p>I want an intermediate result computed before generating the new one to get the benefit of memoization.</p>
  
  <pre><code>import qualified Data.Map.Strict as M
  import Data.List
  parts' m = newmap
      where
      n = M.size m + 1 
      lists =  nub $ map sort $ 
          [n] : (concat $ map (\i -&gt; map (i:) (M.findWithDefault [] (n-i) m)) [1..n])
      newmap = seq lists (M.insert n lists m)
  </code></pre>
  
  <p>But, then if I do</p>
  
  <pre><code>take 2000 (iterate parts' (M.fromList [(1,[[1]])]))
  </code></pre>
  
  <p>It still completes instantaneously.</p>
  
  <p>(Can using an Array instead of a Map help?)</p>