Char -> Int
Convert a single digit Char to the corresponding Int. This function fails unless its argument satisfies isHexDigit, but recognises both upper and lower-case hexadecimal digits (i.e. '0'..'9', 'a'..'f', 'A'..'F').
The Prelude.fromEnum method restricted to the type Data.Char.Char.
count returns the number of times its argument appears in the ByteString
> count = length . elemIndices
Also
> count '\n' == length . lines
But more efficiently than using length on the intermediate list.
Compute size of an arbitrary data structure
Determine depth of the given term
Count the number of immediate subterms of the given term
Determine the number of all nodes in a given term
O(n) The elemIndex function returns the index of the first element in the given ByteString which is equal (by memchr) to the query element, or Nothing if there is no such element.
O(n) The elemIndexEnd function returns the last index of the element in the given ByteString which is equal to the query element, or Nothing if there is no such element. The following holds:
> elemIndexEnd c xs ==
> (-) (length xs - 1) `fmap` elemIndex c (reverse xs)
O(n) The elemIndices function extends elemIndex, by returning the indices of all elements equal to the query element, in ascending order.
Raise any value as an exception, provided it is in the Typeable class.
Show more results