length -package:vector -package:protolude package:haskell-gi-base

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 *
Map over the GValues inside a C array.
Unpack an array of contiguous GValues into a list of GValues.