On Wed, May 27, 2009 at 20:35:09 +0200, Reinier Lamers wrote:
> I'm not a guru, but I've done this thing before. This patch is correct. 
> Before 
> the IO Bool from checkPristineAgainstSlurpy can be used, the boolean itself 
> has to be computed. So no funny things about exceptions arising when the bool 
> is computed from it.
> 
> It might be a good idea to add a comment to checkPristineAgainstSlurpy that 
> it 
> may throw exceptions, and that explains the strictification. A patch adding 
> such comment is attached.

Applied, thanks! (especially for doing things in a way that saves
needless emailing, i.e. your comment patch)

> Writing this comment prompted me to wonder why darcs runs code that throws 
> exceptions inside unsafeInterleaveIO. That's asking for trouble. I think the 
> real solution would be to move the catch inside the unsafeInterleaveIO and 
> have the unsafeInterleaveIO'd function return a Maybe or Either.

Is this something you foresee yourself working on, Reinier or Petr?

Add comment explaining strictification of checkPristineAgainstSlurpy
--------------------------------------------------------------------
> Reinier Lamers <[email protected]>**20090527181347
>  Ignore-this: bb5f661a7a2d623c925142c7c96c3688
> ] hunk ./src/Darcs/Repository/Internal.hs 1007
>  checkPristineAgainstSlurpy repository@(Repo _ opts _ _) s2 =
>      do s1 <- slurp_recorded repository
>         ftf <- filetype_function
> +       -- The @$!@ is necessary because some code called from this function 
> uses
> +       -- unsafeInterleaveIO around functions that throw exceptions. If one 
> used
> +       -- @$@ instead of @$!@ here, those exceptions might not be caught by 
> code
> +       -- that runs this function inside a @ca...@.
>         return $! nullFL $ unsafeDiff (LookForAdds:IgnoreTimes:opts) ftf s1 s2

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9

Attachment: signature.asc
Description: Digital signature

_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to