Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- 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
Instances
Concrete List Source # | |
Defined in CPython.Types.List concreteType :: List -> Type | |
Object List Source # | |
Defined in CPython.Internal toObject :: List -> SomeObject Source # fromForeignPtr :: ForeignPtr List -> List | |
Sequence List Source # | |
Defined in CPython.Protocols.Sequence toSequence :: List -> SomeSequence Source # |
iterableToList :: Object iter => iter -> IO List Source #
Convert any object implementing the iterator protocol to a List
.
getItem :: List -> Integer -> IO SomeObject Source #
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 List Source #
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.
reverse :: List -> IO () Source #
Reverses the items of a list in place. This is equivalent to
list.reverse()
.
toTuple :: List -> IO Tuple Source #
Return a new Tuple
containing the contents of a list; equivalent to
tuple(list)
.