Jason Dagit wrote: > On Tue, Oct 7, 2008 at 4:36 AM, [EMAIL PROTECTED] wrote: >> Yes, this is ok, I was just confused. What is not ok is that execSendmail >> gets called /outside/ the body of the withOpenTemp that creates the >> attached file. That is, the file gets deleted before the sendmail command >> is called. I have a patch that should fix this, which I will send later >> today (after some testing). This bug, BTW, nicely illustrates a weakness >> of the withXYZ idiom: it cannot statically prevent that some resource >> allocated (in this case the name of the tempfile) 'escapes' the body, >> i.e. its scope of validity. I strongly support the idea to investigate >> whether parts of the darcs code can be refactored to use Oleg's latest >> enumerator stuff, as suggested recently on this list. > > I don't have this code handy, but could we also use universal > quantification > on the XYZ's type to prevent it from escaping like with the ST monad? > Just a thought, not sure if it makes sense here.
I think it makes sense, indeed. Oleg Kiselyov and Chung-shieh Shan have interesting things to say about that approach, too, see http://www.cs.rutgers.edu/~ccshan/capability/region-io.pdf The iteratee/enumerator stuff is described here: http://okmij.org/ftp/Haskell/Iteratee/DEFUN08-talk-notes.pdf Cheers Ben _______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
