null
Test whether the structure is empty. The default implementation is
Left-associative and lazy in both the initial element and the
accumulator. Thus optimised for structures where the first element can
be accessed in constant time. Structures where this is not the case
should have a non-default implementation.
Examples
Basic usage:
>>> null []
True
>>> null [1]
False
null is expected to terminate even for infinite structures. The
default implementation terminates provided the structure is bounded on
the left (there is a leftmost element).
>>> null [1..]
False
Test whether a list is empty.
>>> null []
True
>>> null [1]
False
>>> null [1..]
False
O(1) Test whether a ByteString is empty.
O(1) Tests whether a
Text is empty or not.
Is the map empty?
Data.IntMap.null (empty) == True
Data.IntMap.null (singleton 1 'a') == False
Is the map empty?
Data.Map.null (empty) == True
Data.Map.null (singleton 1 'a') == False
Is this the empty sequence?
Return
True if this map is empty,
False
otherwise.
Return
True if this set is empty,
False
otherwise.
>>> HashSet.null HashSet.empty
True
>>> HashSet.null (HashSet.singleton 1)
False
O(1). Determine if a
Deque is
empty.
>>> Control.Lens.Internal.Deque.null empty
True
>>> Control.Lens.Internal.Deque.null (singleton 1)
False
True if there are no values in the stream.
This function does not modify the stream.
Checks if there are no more bytes in the underlying representation.
Is the map empty?
Data.Word64Map.null (empty) == True
Data.Word64Map.null (singleton 1 'a') == False
Returns true if the passed-in UUID is the
nil UUID.
Check if a byte array is empty