Safe Haskell | None |
---|---|
Language | Haskell2010 |
Transactional list
- data TList a
- data TNode a
- empty :: STM (TList a)
- singleton :: e -> STM (TList e)
- null :: TList e -> STM Bool
- length :: TList e -> STM Word
- first :: TList e -> STM (Maybe (TNode e))
- last :: TList e -> STM (Maybe (TNode e))
- prev :: TNode a -> STM (Maybe (TNode a))
- next :: TNode a -> STM (Maybe (TNode a))
- value :: TNode a -> a
- deleteAll :: TList a -> STM ()
- delete :: TNode a -> STM ()
- filter :: (e -> STM Bool) -> TList e -> STM ()
- find :: (e -> STM Bool) -> TList e -> STM (Maybe (TNode e))
- append :: a -> TList a -> STM (TNode a)
- append_ :: a -> TList a -> STM ()
- prepend :: a -> TList a -> STM (TNode a)
- prepend_ :: a -> TList a -> STM ()
- insertBefore :: a -> TNode a -> STM (TNode a)
- insertAfter :: a -> TNode a -> STM (TNode a)
- toList :: TList a -> STM [a]
- toReverseList :: TList a -> STM [a]
- fromList :: [e] -> STM (TList e)
- index :: Word -> TList e -> STM (Maybe (TNode e))
- take :: Word -> TList e -> STM [e]
Documentation
A node in the list
Every list has a marker node whose value is Nothing. Its nodePrev links to the last node and its nodeNext links to the first node.
find :: (e -> STM Bool) -> TList e -> STM (Maybe (TNode e)) Source #
Find the first node matching the predicate (if any)
toReverseList :: TList a -> STM [a] Source #
Convert into a reversed list (O(n))