Int -> Double
O(log n). Retrieve an element by its index, i.e. by its zero-based index in the sorted sequence of elements. If the index is out of range (less than zero, greater or equal to size of the set), error is called.
> elemAt 0 (fromList [5,3]) == 3
> elemAt 1 (fromList [5,3]) == 5
> elemAt 2 (fromList [5,3]) Error: index out of range
List index (subscript) operator, starting from 0. It is an instance of the more general Data.List.genericIndex, which takes an index of any integral type.
O(log(min(i,n-i))). The element at the specified position, counting from 0. The argument should thus be a non-negative integer less than the size of the sequence. If the position is out of range, index fails with an error.
O(min(n,W)). Find the value at a key. Calls error when the element can not be found.
> fromList [(5,'a'), (3,'b')] ! 1 Error: element not in the map
> fromList [(5,'a'), (3,'b')] ! 5 == 'a'
Raise any value as an exception, provided it is in the Typeable class.
Show more results