Copyright | Allele Dev 2016 |
---|---|
License | BSD-3 |
Maintainer | allele.dev@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe |
Language | Haskell2010 |
- Constant-time append(><) and snoc(|>)
- Average constant-time viewL (left-edge deconstruction)
Using http://okmij.org/ftp/Haskell/extensible/FTCQueue1.hs as a starting point.
A minimal version of FTCQueue from "Reflection w/o Remorse":
- research: http://okmij.org/ftp/Haskell/Reflection.html
- type-aligned(FTCQueue): https://hackage.haskell.org/package/type-aligned
- data FTCQueue m a b
- tsingleton :: (a -> m b) -> FTCQueue m a b
- (|>) :: FTCQueue m a x -> (x -> m b) -> FTCQueue m a b
- snoc :: FTCQueue m a x -> (x -> m b) -> FTCQueue m a b
- (><) :: FTCQueue m a x -> FTCQueue m x b -> FTCQueue m a b
- append :: FTCQueue m a x -> FTCQueue m x b -> FTCQueue m a b
- data ViewL m a b where
- tviewl :: FTCQueue m a b -> ViewL m a b
Documentation
Non-empty tree. Deconstruction operations make it more and more left-leaning
tsingleton :: (a -> m b) -> FTCQueue m a b Source #
Build a leaf from a single operation [O(1)]
(|>) :: FTCQueue m a x -> (x -> m b) -> FTCQueue m a b Source #
Append an operation to the right of the tree [O(1)]
(><) :: FTCQueue m a x -> FTCQueue m x b -> FTCQueue m a b Source #
Append two trees of operations [O(1)]