
Chaddaï Fouché wrote:
getValues update initial = go initial =<< gen where go v [] = return v go v (f:fs) = do x <- val f
You say that this stream lazily, so I deduce that gen produce a lazy IO list. So you should be able to use gen in conjunction with easyList to get your bloom filter lazily. I'm not sure what the problem is ? How exactly do you get the elements of your bloom filter from gen input ?
gen produces a lazy list, but it's then transformed using another IO operation. I added the relevant line back above. I did it that way to preserve laziness. An alternate, simpler getvalues suitable for easyList[1] would be the following, but due to the sequencing done by mapM, the list does not stream out lazily. getValues :: IO [v] getValues update initial = mapM val =<< gen -- see shy jo [1] If easyList didn't also destroy laziness by running length, anyway..