JonasDuregard / testing-feat

FEAT
BSD 3-Clause "New" or "Revised" License
25 stars 9 forks source link

Fix space leak in ioFeat #4

Closed michalpalka closed 7 years ago

michalpalka commented 7 years ago

ioFeat contains a call to mapM with a potentially very long list, which leads to a space leak, as the result list is retained until the end of the computation.

You can demonstrate the problem by executing the following code:

module Main where

import Test.Feat

main = featCheck 45 ((\_ -> True) :: [Bool] -> Bool)

With the current version of testing-feat, the code requires over 200MB of memory, whereas only 2 MB is consumed if we replacemapM with mapM_ in ioFeat, as proposed in this PR.