> > I don't believe that it will break many programs. How many programs > > produce large *input independent* output, that is not already > > literally in the source, in a caf with a long life-time? > > That sounds like a description of all the animation programs in Paul > Hudak's School of Expression book and there's plenty more examples > like that. > > [I haven't tested whether these programs do leak space with the > modified compiler - my point is that there is a large class of > programs with exactly the characteristics you describe.] > > -- > Alastair Reid > > ps I think your CAF restriction is a bit of a red herring - Koen's > modification to make his example leak in GHC (which GCs CAFs) shows > that the leak happens as long as the relevant thunk isn't collected.
This whole discussion is a red herring. The Haskell report doesn't say anything about sharing - it doesn't even mandate laziness (look in the index - you won't find the term "lazy" :-). Different compilers will behave differently, GHC in particular will probably share <expr2> in Koen's example f = do <expr1> <expr2> regardless of whether the translation uses >> or >>=, because GHC implements full laziness (when -O is turned on). So you might reasonably argue that Haskell should provide more control over such things, and I might well agree. But there's no point in discussing whether using >>= or >> in the translation of do-notation is better: they're both equivalent as far as the current language specification is concerned. Cheers, Simon _______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell