Module
Data.CatList
- Package
- catenable-lists
- Repository
- purescript/purescript-catenable-lists
This module defines a strict catenable list.
The implementation is based on a queue where all operations require
O(1)
amortized time.
However, any single uncons
operation may run in O(n)
time.
See Purely Functional Data Structures (Okasaki 1996)
#CatList Source
data CatList a
A strict catenable list.
CatList
may be empty, represented by CatNil
.
CatList
may be non-empty, represented by CatCons
. The CatCons
data constructor takes the first element of the list and a queue of
CatList
.
Constructors
Instances
- Modules
- Data.
CatList - Data.
CatQueue
Running time:
O(1)