length -package:bytestring -package:utf8-string -package:filepath -package:vector -package:rio -package:base

O(n) Returns the number of characters in a Text.
O(n) Returns the number of characters in a Stream. Properties
length . stream = length
O(n) Returns the number of characters in a text.
O(n) Returns the number of characters in a Text.
The number of elements in the sequence.
Count how many values are in the stream. Subject to fusion
Returns the size/length of a finite structure as an Int. The default implementation just counts elements starting with the leftmost. Instances for structures that can compute the element count faster than via element-by-element counting, should provide a specialised implementation.

Examples

Basic usage:
>>> length []
0
>>> length ['a', 'b', 'c']
3

>>> length [1..]
* Hangs forever *
Return the length in bytes of a bytearray
Count the number of elements in a Producer
Number of elements in NonEmpty list.
Return the length of the container
Return the length of the byte stream in bytes
Return the length of the text stream in characters
Returns the size/length of a finite structure as an Int. The default implementation just counts elements starting with the leftmost. Instances for structures that can compute the element count faster than via element-by-element counting, should provide a specialised implementation.

Examples

Basic usage:
>>> length []
0
>>> length ['a', 'b', 'c']
3

>>> length [1..]
* Hangs forever *
@since base-4.8.0.0
Run a stream, keeping its length and its return value.
>>> S.print $ mapped S.length $ chunksOf 3 $ S.each [1..10]
3
3
3
1
Synonym for olength
Count the number of Unicode code-points in a ShortText.
>>> length "abcd€"
5
>>> length ""
0
length t >= 0
Count the number of bytes
The length of a slice of bytes.
The total number of bytes in all the chunks.
O(n/c) length returns the length of a byte stream as an Int together with the return value. This makes various maps possible.
>>> Q.length "one\ntwo\three\nfour\nfive\n"
23 :> ()

>>> S.print $ S.take 3 $ mapped Q.length $ Q.lines "one\ntwo\three\nfour\nfive\n"
3
8
4
Length of the list. See also genericLength.