ajhc- Haskell compiler that produce binary through C language

Safe HaskellNone



a simple type that only lets an IO action happen once, caching its result.



data Once a Source


newOnce :: IO (Once a)Source

create a new Once object

runOnce :: Once a -> IO a -> IO aSource

execute the action at most once, always returning the same result

altOnce :: Once () -> IO b -> IO b -> IO bSource

run first argument once, after which perform the second

data OnceMap a b Source

run an IO action at most once for each distinct argument


runOnceMap :: Ord a => OnceMap a b -> a -> IO b -> IO bSource

altOnceMap :: Ord a => OnceMap a () -> a -> IO b -> IO b -> IO bSource

onceMapToList :: OnceMap a b -> IO [(a, b)]Source