all package:base

Determines whether all elements of the structure satisfy the predicate.

Examples

Basic usage:
>>> 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 *
Applied to a predicate and a list, all determines if all elements of the list satisfy the predicate. For the result to be True, the list must be finite; False, however, results from a False value for the predicate applied to an element at a finite index of a finite or infinite list.

Examples

>>> 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 *
Boolean monoid under conjunction (&&).
All x <> All y = All (x && y)

Examples

>>> All True <> mempty <> All False)
All {getAll = False}
>>> mconcat (map (\x -> All (even x)) [2,4,6,7,8])
All {getAll = False}
>>> All True <> mempty
All {getAll = True}
When invoked inside mask, this function allows a masked asynchronous exception to be raised, if one exists. It is equivalent to performing an interruptible operation (see #interruptible), but does not involve any actual blocking. When called outside mask, or inside uninterruptibleMask, this function has no effect.
alloca f executes the computation f, passing as argument a pointer to a temporarily allocated block of memory sufficient to hold values of type a. The memory is freed when f terminates (either normally or via an exception), so the pointer passed to f must not be used after this.
allocaBytes n f executes the computation f, passing as argument a pointer to a temporarily allocated block of memory of n bytes. The block of memory is sufficiently aligned for any of the basic foreign types that fits into a memory block of the allocated size. The memory is freed when f terminates (either normally or via an exception), so the pointer passed to f must not be used after this.
allocaBytesAligned size align f executes the computation f, passing as argument a pointer to a temporarily allocated block of memory of size bytes and aligned to align bytes. The value of align must be a power of two. The memory is freed when f terminates (either normally or via an exception), so the pointer passed to f must not be used after this.
Temporarily allocate space for the given number of elements (like alloca, but for multiple elements).
Like allocaArray, but add an extra position to hold a special termination element.
Total bytes allocated
This thread has exceeded its allocation limit. See setAllocationCounter and enableAllocationLimit.
The module Foreign.Marshal.Alloc provides operations to allocate and deallocate blocks of raw memory (i.e., unstructured chunks of memory outside of the area maintained by the Haskell storage manager). These memory blocks are commonly used to pass compound data structures to foreign functions or to provide space in which compound result values are obtained from foreign functions. If any of the allocation functions fails, an exception is thrown. In some cases, memory exhaustion may mean the process is terminated. If free or reallocBytes is applied to a memory area that has been allocated with alloca or allocaBytes, the behaviour is undefined. Any further access to memory areas allocated with alloca or allocaBytes, after the computation that was passed to the allocation function has terminated, leads to undefined behaviour. Any further access to the memory area referenced by a pointer passed to realloc, reallocBytes, or free entails undefined behaviour. All storage allocated by functions that allocate based on a size in bytes must be sufficiently aligned for any of the basic foreign types that fits into the newly allocated storage. All storage allocated by functions that allocate based on a specific type must be sufficiently aligned for that type. Array allocation routines need to obey the same alignment constraints for each array element. The underlying implementation is wrapping the stdlib.h malloc, realloc, and free. In other words it should be safe to allocate using C-malloc, and free memory with free from this module.
Fork a thread and call the supplied function when the thread is about to terminate, with an exception or a returned value. The function is called with asynchronous exceptions masked.
forkFinally action and_then =
mask $ \restore ->
forkIO $ try (restore action) >>= and_then
This function is useful for informing the parent when a child terminates, for example.
This is thrown when the user calls error. The String is the argument given to error. Historically, there was a second String for the location, but it was subsumed by the backtrace mechanisms (since base-4.22).
Deprecated: ErrorCallWithLocation has been deprecated in favour of ErrorCall (which does not have a location). Backtraces are now handled by the backtrace exception mechanisms exclusively.
Thrown when the program attempts to call atomically, from the stm package, inside another call to atomically.
A specialised variant of bracket with just a computation to run afterward.
collect HasCallStack backtraces