2module Control.AutoUpdate.Util
6#ifndef MIN_VERSION_base
7#define MIN_VERSION_base(x,y,z) 1
10#if MIN_VERSION_base(4,6,0)
11import Data.IORef (atomicModifyIORef')
13import Data.IORef (IORef, atomicModifyIORef)
14-- | Strict version of 'atomicModifyIORef'. This forces both the value stored
15-- in the 'IORef' as well as the value returned.
16atomicModifyIORef' :: IORef a -> (a -> (a,b)) -> IO b
17atomicModifyIORef' ref f = do
18 c <- atomicModifyIORef ref
19 (\x -> let (a, b) = f x -- Lazy application of "f"
20 in (a, a `seq` b)) -- Lazy application of "seq"
21 -- The following forces "a `seq` b", so it also forces "f x".
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list