Have you ever wanted to restrict an IO action such that it could only be invoked once? Now you can with System.IO.Memoize.once (formerly known as ioMemo).
Need slightly more complicated logic? (e.g. An IO callback that takes an argument but then only executes the first time around, essentially ignoring the argument the other times it is called.) Leverage the dead simple "write once" Control.Concurrent.Cache api for fun and profit. 1. Create an empty cache with newCache 2. fetch repeatedly from the cache, each time providing a fallback in case it is empty. 3. There is no step 3. Fetching from a Cache is thread safe: only one "fallback" will execute at a time, and after the first successful fallback, the cached value will be set and no other fallbacks will be called. -- Dan Burton
_______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell