Safe Haskell | None |
---|---|
Language | Haskell98 |
- class Object a => Sequence a where
- data SomeSequence
- castToSequence :: Object a => a -> IO (Maybe SomeSequence)
- length :: Sequence self => self -> IO Integer
- append :: (Sequence a, Sequence b) => a -> b -> IO SomeSequence
- repeat :: Sequence a => a -> Integer -> IO a
- inPlaceAppend :: (Sequence a, Sequence b) => a -> b -> IO SomeSequence
- inPlaceRepeat :: Sequence a => a -> Integer -> IO a
- getItem :: Sequence self => self -> Integer -> IO SomeObject
- setItem :: (Sequence self, Object v) => self -> Integer -> v -> IO ()
- deleteItem :: Sequence self => self -> Integer -> IO ()
- getSlice :: Sequence self => self -> Integer -> Integer -> IO SomeObject
- setSlice :: (Sequence self, Object v) => self -> Integer -> Integer -> v -> IO ()
- deleteSlice :: Sequence self => self -> Integer -> Integer -> IO ()
- count :: (Sequence self, Object v) => self -> v -> IO Integer
- contains :: (Sequence self, Object v) => self -> v -> IO Bool
- index :: (Sequence self, Object v) => self -> v -> IO Integer
- toList :: Sequence seq => seq -> IO List
- toTuple :: Sequence seq => seq -> IO Tuple
- fast :: Sequence seq => seq -> Text -> IO SomeSequence
Documentation
class Object a => Sequence a where Source #
toSequence :: a -> SomeSequence Source #
castToSequence :: Object a => a -> IO (Maybe SomeSequence) Source #
inPlaceAppend :: (Sequence a, Sequence b) => a -> b -> IO SomeSequence Source #
index :: (Sequence self, Object v) => self -> v -> IO Integer Source #
Return the first index i for which self[i] == v
. This is equivalent
to the Python expression self.index(v)
.
toList :: Sequence seq => seq -> IO List Source #
Return a list object with the same contents as the arbitrary sequence seq. The returned list is guaranteed to be new.
toTuple :: Sequence seq => seq -> IO Tuple Source #
Return a tuple object with the same contents as the arbitrary sequence seq. If seq is already a tuple, it is re-used rather than copied.
fast :: Sequence seq => seq -> Text -> IO SomeSequence Source #
Returns the sequence seq as a tuple, unless it is already a tuple or
list, in which case seq is returned. If an error occurs, throws
TypeError
with the given text as the exception text.