23 Oct
2009
23 Oct
'09
6:30 p.m.
Hello again,
then, barring memory pressure forcing it out, it will be computed only once (each list element will be computed only once, when it's first needed).
Thanks Daniel, that was what I was after. Is there any way of investigating these things without using the profiler? E.g. is there any way to stick a debug print statement inside a function without moving over to sideeffects and IO Monads etc.. I know printing is a side effect, but it would be nice to say 'I can has itsy sneeky side effect plz Haskell, just for little testing while' Cheers, Philip