[reactive] Bug fixes in progress

Conal Elliott conal at conal.net
Sun May 31 18:33:20 EDT 2009


I've pushed Svein's patch, plus some small tweaks of my own, to the darcs
repo at http://code.haskell.org/unamb .  Comments, please.  I have a pretty
tenuous grip on this block/unblock/retry stuff.

  - Conal

On Sun, May 31, 2009 at 2:04 PM, Svein Ove Aas <svein.ove at aas.no> wrote:

> On Sat, May 30, 2009 at 5:48 PM, Bertram Felgenhauer
> <bertram.felgenhauer at googlemail.com> wrote:
> > Sterling Clover wrote:
> >> This is perhaps a silly idea, but perhaps useful -- there should be a
> >> version of unsafePerformIO that always does the "right" thing with
> regards
> >> to exceptions. From that, the other unamb primitives can perhaps be
> built
> >> more obviously? Additionally, this implementation would be potentially
> >> useful to libraries beyond unamb.
> >
> > You mean something like this?
> >
> > -- | A version of 'unsafePerformIO' that assures that the resulting
> > --   (pure) computation can be restarted if it is killed by an
> > --   asynchronous exception. Note that as a result, the IO action
> > --   may be performed more than once.
> > exceptionSafeUnsafePerformIO act = unsafePerformIO $ retry act
> >    where
> >        retry act = unblock act `catch` \SomeException e -> do
> >             myid <- myThreadId
> >             throwTo myid e
> >             retry act
> >
> > That could be useful indeed.
> >
> Let's call it restartingUnsafePerformIO, though. It's not in any way
> "safer" than the normal one - in a number of circumstances it's less
> safe.
>
>
> Besides that, I've turned in a patch documenting this discussion in
> Unamb.hs. You can see the resulting commentary in
> http://brage.info/~svein/unamb.patch<http://brage.info/%7Esvein/unamb.patch>for the time being; feel free to
> tell me it's mistaken in some respect.
>
> --
> Svein Ove Aas
> _______________________________________________
> Reactive mailing list
> Reactive at haskell.org
> http://www.haskell.org/mailman/listinfo/reactive
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/reactive/attachments/20090531/ff4757a8/attachment-0001.html


More information about the Reactive mailing list