Safe Haskell | None |
---|
- data List
- listType :: Type
- toList :: [SomeObject] -> IO List
- iterableToList :: Object iter => iter -> IO List
- fromList :: List -> IO [SomeObject]
- length :: List -> IO Integer
- getItem :: List -> Integer -> IO SomeObject
- setItem :: Object o => List -> Integer -> o -> IO ()
- insert :: Object item => List -> Integer -> item -> IO ()
- append :: Object item => List -> item -> IO ()
- getSlice :: List -> Integer -> Integer -> IO List
- setSlice :: List -> Integer -> Integer -> Maybe List -> IO ()
- sort :: List -> IO ()
- reverse :: List -> IO ()
- toTuple :: List -> IO Tuple
Documentation
toList :: [SomeObject] -> IO ListSource
iterableToList :: Object iter => iter -> IO ListSource
Convert any object implementing the iterator protocol to a List
.
fromList :: List -> IO [SomeObject]Source
getItem :: List -> Integer -> IO SomeObjectSource
Returns the object at a given position in the list. The position must be
positive; indexing from the end of the list is not supported. If the
position is out of bounds, throws an IndexError
exception.
insert :: Object item => List -> Integer -> item -> IO ()Source
Inserts item into the list in front of the given index. Throws an
exception if unsuccessful. Analogous to list.insert(index, item)
.
append :: Object item => List -> item -> IO ()Source
Append item to the end of th list. Throws an exception if unsuccessful.
Analogous to list.append(item)
.
getSlice :: List -> Integer -> Integer -> IO ListSource
Return a list of the objects in list containing the objects between
the given indexes. Throws an exception if unsuccessful. Analogous to
list[low:high]
. Negative indices, as when slicing from Python, are not
supported.
Sets the slice of a list between low and high to the contents of
a replacement list. Analogous to list[low:high] = replacement
. The
replacement may be Nothing
, indicating the assignment of an empty list
(slice deletion). Negative indices, as when slicing from Python, are not
supported.