>>> all (> 3) [] True
>>> all (> 3) [1,2] False
>>> all (> 3) [1,2,3,4,5] False
>>> all (> 3) [1..] False
>>> all (> 3) [4..] * Hangs forever *
>>> getAll (All True <> mempty <> All False) False
>>> getAll (mconcat (map (\x -> All (even x)) [2,4,6,7,8])) False
forkFinally action and_then = mask $ \restore -> forkIO $ try (restore action) >>= and_thenThis function is useful for informing the parent when a child terminates, for example.
do { p <- malloc; newForeignPtr finalizerFree p }although it may be implemented differently internally: you may not assume that the memory returned by mallocForeignPtr has been allocated with malloc. GHC notes: mallocForeignPtr has a heavily optimised implementation in GHC. It uses pinned memory in the garbage collected heap, so the ForeignPtr does not require a finalizer to free the memory. Use of mallocForeignPtr and associated functions is strongly recommended in preference to newForeignPtr with a finalizer.