|
| Data.DList | | Portability | portable (Haskell 98) | | Stability | experimental | | Maintainer | dons@cse.unsw.edu.au |
|
|
|
|
|
| Description |
| Difference lists: a data structure for O(1) append on lists.
|
|
| Synopsis |
|
|
|
| Documentation |
|
| type DList a = [a] -> [a] |
A difference list is a function that given a list, returns the
original contents of the difference list prepended at the given list
This structure supports O(1) append and snoc operations on lists.
|
|
| Construction
|
|
| fromList :: [a] -> DList a |
| Converting a normal list to a dlist
|
|
| toList :: DList a -> [a] |
| Converting a dlist back to a normal list
|
|
| Basic functions
|
|
| empty :: DList a |
| Create a difference list containing no elements
|
|
| singleton :: a -> DList a |
| Create difference list with given single element
|
|
| snoc :: DList a -> a -> DList a |
| O(1), Append a single element at a difference list
|
|
| append :: DList a -> DList a -> DList a |
| Appending difference lists
|
|
| Produced by Haddock version 0.8 |