freer-0.2.2.6: Implementation of the Freer Monad

CopyrightAlej Cabrera 2015
LicenseBSD-3
Maintainercpp.cabrera@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

Data.FTCQueue

Description

  • 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":

Synopsis

Documentation

data FTCQueue m a b Source

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)]

snoc :: FTCQueue m a x -> (x -> m b) -> FTCQueue m a b Source

An alias for '(|>)'

(><) :: FTCQueue m a x -> FTCQueue m x b -> FTCQueue m a b Source

Append two trees of operations [O(1)]

append :: FTCQueue m a x -> FTCQueue m x b -> FTCQueue m a b Source

An alias for '(><)'

data ViewL m a b where Source

Left view deconstruction data structure

Constructors

TOne :: (a -> m b) -> ViewL m a b 
(:|) :: (a -> m x) -> FTCQueue m x b -> ViewL m a b 

tviewl :: FTCQueue m a b -> ViewL m a b Source

Left view deconstruction [average O(1)]