dlist-0.1: ContentsIndex
Data.DList
Portabilityportable (Haskell 98)
Stabilityexperimental
Maintainerdons@cse.unsw.edu.au
Contents
Construction
Basic functions
Description
Difference lists: a data structure for O(1) append on lists.
Synopsis
type DList a = [a] -> [a]
fromList :: [a] -> DList a
toList :: DList a -> [a]
empty :: DList a
singleton :: a -> DList a
snoc :: DList a -> a -> DList a
append :: DList a -> DList a -> DList a
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