Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type Weight = Word
- newtype Index = Index {}
- newtype Size = Size {}
- data BTree a
- data WTree a = WTree {}
- pattern WLeaf :: forall a. Weight -> a -> WTree a
- pattern WNode :: forall a. Weight -> WTree a -> WTree a -> WTree a
- data Urn a = Urn {}
- sample :: WTree a -> Index -> a
- bsample :: BTree a -> Index -> a
- insert :: Weight -> a -> Urn a -> Urn a
- uninsert :: Urn a -> (Weight, a, Weight, Maybe (Urn a))
- update :: (Weight -> a -> (Weight, a)) -> WTree a -> Index -> (Weight, a, Weight, a, WTree a)
- replace :: Weight -> a -> WTree a -> Index -> (Weight, a, WTree a)
- construct :: NonEmpty (Weight, a) -> Urn a
- foldWTree :: (Weight -> a -> b) -> (Weight -> b -> WTree a -> b) -> (Weight -> WTree a -> b -> b) -> Size -> WTree a -> b
- randomIndexWith :: Functor f => ((Word, Word) -> f Word) -> Urn a -> f Index
- showUrnTreeStructureWith :: (a -> String) -> Urn a -> String
- showUrnTreeStructure :: Show a => Urn a -> String
Types
Parameters of the trees
Tree types (and constructors)
Sampling/lookup (WTree
s and BTree
s)
Insertion (Urn
s)
Update and construct (WTree
s)
update :: (Weight -> a -> (Weight, a)) -> WTree a -> Index -> (Weight, a, Weight, a, WTree a) Source #
General weight-based WTree
traversal
foldWTree :: (Weight -> a -> b) -> (Weight -> b -> WTree a -> b) -> (Weight -> WTree a -> b -> b) -> Size -> WTree a -> b Source #