Copyright | Copyright (c) 2009-2017 David Sorokin <david.sorokin@gmail.com> |
---|---|
License | BSD3 |
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Tested with: GHC 8.0.1
An imperative double-linked list.
Synopsis
- data DoubleLinkedList m a
- listNull :: MonadRef m => DoubleLinkedList m a -> Event m Bool
- listCount :: MonadRef m => DoubleLinkedList m a -> Event m Int
- newList :: MonadRef m => Simulation m (DoubleLinkedList m a)
- listInsertFirst :: MonadRef m => DoubleLinkedList m a -> a -> Event m ()
- listAddLast :: MonadRef m => DoubleLinkedList m a -> a -> Event m ()
- listRemoveFirst :: MonadRef m => DoubleLinkedList m a -> Event m ()
- listRemoveLast :: MonadRef m => DoubleLinkedList m a -> Event m ()
- listRemove :: (Eq a, Functor m, MonadRef m) => DoubleLinkedList m a -> a -> Event m Bool
- listRemoveBy :: MonadRef m => DoubleLinkedList m a -> (a -> Bool) -> Event m (Maybe a)
- listContains :: (Eq a, Functor m, MonadRef m) => DoubleLinkedList m a -> a -> Event m Bool
- listContainsBy :: MonadRef m => DoubleLinkedList m a -> (a -> Bool) -> Event m (Maybe a)
- listFirst :: MonadRef m => DoubleLinkedList m a -> Event m a
- listLast :: MonadRef m => DoubleLinkedList m a -> Event m a
- clearList :: MonadRef m => DoubleLinkedList m a -> Event m ()
- freezeList :: MonadRef m => DoubleLinkedList m a -> Event m [a]
Documentation
data DoubleLinkedList m a Source #
The DoubleLinkedList
type represents an imperative double-linked list.
listNull :: MonadRef m => DoubleLinkedList m a -> Event m Bool Source #
Test whether the list is empty.
listCount :: MonadRef m => DoubleLinkedList m a -> Event m Int Source #
Return the number of elements in the list.
newList :: MonadRef m => Simulation m (DoubleLinkedList m a) Source #
Create a new list.
listInsertFirst :: MonadRef m => DoubleLinkedList m a -> a -> Event m () Source #
Insert a new element in the beginning.
listAddLast :: MonadRef m => DoubleLinkedList m a -> a -> Event m () Source #
Add a new element to the end.
listRemoveFirst :: MonadRef m => DoubleLinkedList m a -> Event m () Source #
Remove the first element.
listRemoveLast :: MonadRef m => DoubleLinkedList m a -> Event m () Source #
Remove the last element.
listRemove :: (Eq a, Functor m, MonadRef m) => DoubleLinkedList m a -> a -> Event m Bool Source #
Remove the specified element from the list and return a flag indicating whether the element was found and removed.
listRemoveBy :: MonadRef m => DoubleLinkedList m a -> (a -> Bool) -> Event m (Maybe a) Source #
Remove an element satisfying the specified predicate and return the element if found.
listContains :: (Eq a, Functor m, MonadRef m) => DoubleLinkedList m a -> a -> Event m Bool Source #
Detect whether the specified element is contained in the list.
listContainsBy :: MonadRef m => DoubleLinkedList m a -> (a -> Bool) -> Event m (Maybe a) Source #
Detect whether an element satisfying the specified predicate is contained in the list.
clearList :: MonadRef m => DoubleLinkedList m a -> Event m () Source #
Clear the contents of the list.
freezeList :: MonadRef m => DoubleLinkedList m a -> Event m [a] Source #
Freeze the list and return its contents.