EdisonCore-1.3.1.1: A library of efficent, purely-functional data structures (Core Implementations)

CopyrightCopyright (c) 2002 2008 Andrew Bromage
LicenseMIT; see COPYRIGHT file for terms and conditions
Maintainerrobdockins AT fastmail DOT fm
Stabilitystable
PortabilityGHC, Hugs (MPTC and FD)
Safe HaskellNone
LanguageHaskell2010

Data.Edison.Assoc.TernaryTrie

Contents

Description

Finite maps implemented as ternary search tries

Synopsis

Type of ternary search tries

data FM k a Source #

Instances

Ord k => Functor (FM k) Source # 

Methods

fmap :: (a -> b) -> FM k a -> FM k b #

(<$) :: a -> FM k b -> FM k a #

Ord k => AssocX (FM k) [k] Source # 

Methods

empty :: FM k a #

singleton :: [k] -> a -> FM k a #

fromSeq :: Sequence seq => seq ([k], a) -> FM k a #

insert :: [k] -> a -> FM k a -> FM k a #

insertSeq :: Sequence seq => seq ([k], a) -> FM k a -> FM k a #

union :: FM k a -> FM k a -> FM k a #

unionSeq :: Sequence seq => seq (FM k a) -> FM k a #

delete :: [k] -> FM k a -> FM k a #

deleteAll :: [k] -> FM k a -> FM k a #

deleteSeq :: Sequence seq => seq [k] -> FM k a -> FM k a #

null :: FM k a -> Bool #

size :: FM k a -> Int #

member :: [k] -> FM k a -> Bool #

count :: [k] -> FM k a -> Int #

lookup :: [k] -> FM k a -> a #

lookupM :: Monad rm => [k] -> FM k a -> rm a #

lookupAll :: Sequence seq => [k] -> FM k a -> seq a #

lookupAndDelete :: [k] -> FM k a -> (a, FM k a) #

lookupAndDeleteM :: Monad rm => [k] -> FM k a -> rm (a, FM k a) #

lookupAndDeleteAll :: Sequence seq => [k] -> FM k a -> (seq a, FM k a) #

lookupWithDefault :: a -> [k] -> FM k a -> a #

adjust :: (a -> a) -> [k] -> FM k a -> FM k a #

adjustAll :: (a -> a) -> [k] -> FM k a -> FM k a #

adjustOrInsert :: (a -> a) -> a -> [k] -> FM k a -> FM k a #

adjustAllOrInsert :: (a -> a) -> a -> [k] -> FM k a -> FM k a #

adjustOrDelete :: (a -> Maybe a) -> [k] -> FM k a -> FM k a #

adjustOrDeleteAll :: (a -> Maybe a) -> [k] -> FM k a -> FM k a #

fold :: (a -> b -> b) -> b -> FM k a -> b #

fold' :: (a -> b -> b) -> b -> FM k a -> b #

fold1 :: (a -> a -> a) -> FM k a -> a #

fold1' :: (a -> a -> a) -> FM k a -> a #

filter :: (a -> Bool) -> FM k a -> FM k a #

partition :: (a -> Bool) -> FM k a -> (FM k a, FM k a) #

elements :: Sequence seq => FM k a -> seq a #

strict :: FM k a -> FM k a #

strictWith :: (a -> b) -> FM k a -> FM k a #

structuralInvariant :: FM k a -> Bool #

instanceName :: FM k a -> String #

Ord k => OrdAssocX (FM k) [k] Source # 

Methods

minView :: Monad rm => FM k a -> rm (a, FM k a) #

minElem :: FM k a -> a #

deleteMin :: FM k a -> FM k a #

unsafeInsertMin :: [k] -> a -> FM k a -> FM k a #

maxView :: Monad rm => FM k a -> rm (a, FM k a) #

maxElem :: FM k a -> a #

deleteMax :: FM k a -> FM k a #

unsafeInsertMax :: [k] -> a -> FM k a -> FM k a #

foldr :: (a -> b -> b) -> b -> FM k a -> b #

foldr' :: (a -> b -> b) -> b -> FM k a -> b #

foldl :: (b -> a -> b) -> b -> FM k a -> b #

foldl' :: (b -> a -> b) -> b -> FM k a -> b #

foldr1 :: (a -> a -> a) -> FM k a -> a #

foldr1' :: (a -> a -> a) -> FM k a -> a #

foldl1 :: (a -> a -> a) -> FM k a -> a #

foldl1' :: (a -> a -> a) -> FM k a -> a #

unsafeFromOrdSeq :: Sequence seq => seq ([k], a) -> FM k a #

unsafeAppend :: FM k a -> FM k a -> FM k a #

filterLT :: [k] -> FM k a -> FM k a #

filterLE :: [k] -> FM k a -> FM k a #

filterGT :: [k] -> FM k a -> FM k a #

filterGE :: [k] -> FM k a -> FM k a #

partitionLT_GE :: [k] -> FM k a -> (FM k a, FM k a) #

partitionLE_GT :: [k] -> FM k a -> (FM k a, FM k a) #

partitionLT_GT :: [k] -> FM k a -> (FM k a, FM k a) #

Ord k => FiniteMapX (FM k) [k] Source # 

Methods

fromSeqWith :: Sequence seq => (a -> a -> a) -> seq ([k], a) -> FM k a #

fromSeqWithKey :: Sequence seq => ([k] -> a -> a -> a) -> seq ([k], a) -> FM k a #

insertWith :: (a -> a -> a) -> [k] -> a -> FM k a -> FM k a #

insertWithKey :: ([k] -> a -> a -> a) -> [k] -> a -> FM k a -> FM k a #

insertSeqWith :: Sequence seq => (a -> a -> a) -> seq ([k], a) -> FM k a -> FM k a #

insertSeqWithKey :: Sequence seq => ([k] -> a -> a -> a) -> seq ([k], a) -> FM k a -> FM k a #

unionl :: FM k a -> FM k a -> FM k a #

unionr :: FM k a -> FM k a -> FM k a #

unionWith :: (a -> a -> a) -> FM k a -> FM k a -> FM k a #

unionSeqWith :: Sequence seq => (a -> a -> a) -> seq (FM k a) -> FM k a #

intersectionWith :: (a -> b -> c) -> FM k a -> FM k b -> FM k c #

difference :: FM k a -> FM k b -> FM k a #

properSubset :: FM k a -> FM k b -> Bool #

subset :: FM k a -> FM k b -> Bool #

submapBy :: (a -> a -> Bool) -> FM k a -> FM k a -> Bool #

properSubmapBy :: (a -> a -> Bool) -> FM k a -> FM k a -> Bool #

sameMapBy :: (a -> a -> Bool) -> FM k a -> FM k a -> Bool #

Ord k => OrdFiniteMapX (FM k) [k] Source # 
Ord k => Assoc (FM k) [k] Source # 

Methods

toSeq :: Sequence seq => FM k a -> seq ([k], a) #

keys :: Sequence seq => FM k a -> seq [k] #

mapWithKey :: ([k] -> a -> b) -> FM k a -> FM k b #

foldWithKey :: ([k] -> a -> b -> b) -> b -> FM k a -> b #

foldWithKey' :: ([k] -> a -> b -> b) -> b -> FM k a -> b #

filterWithKey :: ([k] -> a -> Bool) -> FM k a -> FM k a #

partitionWithKey :: ([k] -> a -> Bool) -> FM k a -> (FM k a, FM k a) #

Ord k => OrdAssoc (FM k) [k] Source # 

Methods

minViewWithKey :: Monad rm => FM k a -> rm (([k], a), FM k a) #

minElemWithKey :: FM k a -> ([k], a) #

maxViewWithKey :: Monad rm => FM k a -> rm (([k], a), FM k a) #

maxElemWithKey :: FM k a -> ([k], a) #

foldrWithKey :: ([k] -> a -> b -> b) -> b -> FM k a -> b #

foldrWithKey' :: ([k] -> a -> b -> b) -> b -> FM k a -> b #

foldlWithKey :: (b -> [k] -> a -> b) -> b -> FM k a -> b #

foldlWithKey' :: (b -> [k] -> a -> b) -> b -> FM k a -> b #

toOrdSeq :: Sequence seq => FM k a -> seq ([k], a) #

Ord k => FiniteMap (FM k) [k] Source # 

Methods

unionWithKey :: ([k] -> a -> a -> a) -> FM k a -> FM k a -> FM k a #

unionSeqWithKey :: Sequence seq => ([k] -> a -> a -> a) -> seq (FM k a) -> FM k a #

intersectionWithKey :: ([k] -> a -> b -> c) -> FM k a -> FM k b -> FM k c #

Ord k => OrdFiniteMap (FM k) [k] Source # 
(Ord k, Eq a) => Eq (FM k a) Source # 

Methods

(==) :: FM k a -> FM k a -> Bool #

(/=) :: FM k a -> FM k a -> Bool #

(Ord k, Ord a) => Ord (FM k a) Source # 

Methods

compare :: FM k a -> FM k a -> Ordering #

(<) :: FM k a -> FM k a -> Bool #

(<=) :: FM k a -> FM k a -> Bool #

(>) :: FM k a -> FM k a -> Bool #

(>=) :: FM k a -> FM k a -> Bool #

max :: FM k a -> FM k a -> FM k a #

min :: FM k a -> FM k a -> FM k a #

(Ord k, Read k, Read a) => Read (FM k a) Source # 

Methods

readsPrec :: Int -> ReadS (FM k a) #

readList :: ReadS [FM k a] #

readPrec :: ReadPrec (FM k a) #

readListPrec :: ReadPrec [FM k a] #

(Ord k, Show k, Show a) => Show (FM k a) Source # 

Methods

showsPrec :: Int -> FM k a -> ShowS #

show :: FM k a -> String #

showList :: [FM k a] -> ShowS #

Ord k => Monoid (FM k a) Source # 

Methods

mempty :: FM k a #

mappend :: FM k a -> FM k a -> FM k a #

mconcat :: [FM k a] -> FM k a #

(Ord k, Arbitrary k, Arbitrary a) => Arbitrary (FM k a) Source # 

Methods

arbitrary :: Gen (FM k a) #

shrink :: FM k a -> [FM k a] #

(Ord k, CoArbitrary k, CoArbitrary a) => CoArbitrary (FM k a) Source # 

Methods

coarbitrary :: FM k a -> Gen b -> Gen b #

AssocX operations

empty :: Ord k => FM k a Source #

singleton :: Ord k => [k] -> a -> FM k a Source #

fromSeq :: (Ord k, Sequence seq) => seq ([k], a) -> FM k a Source #

insert :: Ord k => [k] -> a -> FM k a -> FM k a Source #

insertSeq :: (Ord k, Sequence seq) => seq ([k], a) -> FM k a -> FM k a Source #

union :: Ord k => FM k a -> FM k a -> FM k a Source #

unionSeq :: (Ord k, Sequence seq) => seq (FM k a) -> FM k a Source #

delete :: Ord k => [k] -> FM k a -> FM k a Source #

deleteAll :: Ord k => [k] -> FM k a -> FM k a Source #

deleteSeq :: (Ord k, Sequence seq) => seq [k] -> FM k a -> FM k a Source #

null :: Ord k => FM k a -> Bool Source #

size :: Ord k => FM k a -> Int Source #

member :: Ord k => [k] -> FM k a -> Bool Source #

count :: Ord k => [k] -> FM k a -> Int Source #

lookup :: Ord k => [k] -> FM k a -> a Source #

lookupM :: (Ord k, Monad rm) => [k] -> FM k a -> rm a Source #

lookupAll :: (Ord k, Sequence seq) => [k] -> FM k a -> seq a Source #

lookupAndDelete :: Ord k => [k] -> FM k a -> (a, FM k a) Source #

lookupAndDeleteM :: (Ord k, Monad rm) => [k] -> FM k a -> rm (a, FM k a) Source #

lookupAndDeleteAll :: (Ord k, Sequence seq) => [k] -> FM k a -> (seq a, FM k a) Source #

lookupWithDefault :: Ord k => a -> [k] -> FM k a -> a Source #

adjust :: Ord k => (a -> a) -> [k] -> FM k a -> FM k a Source #

adjustAll :: Ord k => (a -> a) -> [k] -> FM k a -> FM k a Source #

adjustOrInsert :: Ord k => (a -> a) -> a -> [k] -> FM k a -> FM k a Source #

adjustAllOrInsert :: Ord k => (a -> a) -> a -> [k] -> FM k a -> FM k a Source #

adjustOrDelete :: Ord k => (a -> Maybe a) -> [k] -> FM k a -> FM k a Source #

adjustOrDeleteAll :: Ord k => (a -> Maybe a) -> [k] -> FM k a -> FM k a Source #

strict :: FM k a -> FM k a Source #

strictWith :: (a -> b) -> FM k a -> FM k a Source #

map :: Ord k => (a -> b) -> FM k a -> FM k b Source #

fold :: Ord k => (a -> b -> b) -> b -> FM k a -> b Source #

fold' :: Ord k => (a -> b -> b) -> b -> FM k a -> b Source #

fold1 :: Ord k => (a -> a -> a) -> FM k a -> a Source #

fold1' :: Ord k => (a -> a -> a) -> FM k a -> a Source #

filter :: Ord k => (a -> Bool) -> FM k a -> FM k a Source #

partition :: Ord k => (a -> Bool) -> FM k a -> (FM k a, FM k a) Source #

elements :: (Ord k, Sequence seq) => FM k a -> seq a Source #

Assoc operations

toSeq :: (Ord k, Sequence seq) => FM k a -> seq ([k], a) Source #

keys :: (Ord k, Sequence seq) => FM k a -> seq [k] Source #

mapWithKey :: Ord k => ([k] -> a -> b) -> FM k a -> FM k b Source #

foldWithKey :: Ord k => ([k] -> a -> b -> b) -> b -> FM k a -> b Source #

foldWithKey' :: Ord k => ([k] -> a -> b -> b) -> b -> FM k a -> b Source #

filterWithKey :: Ord k => ([k] -> a -> Bool) -> FM k a -> FM k a Source #

partitionWithKey :: Ord k => ([k] -> a -> Bool) -> FM k a -> (FM k a, FM k a) Source #

FiniteMapX operations

fromSeqWith :: (Ord k, Sequence seq) => (a -> a -> a) -> seq ([k], a) -> FM k a Source #

fromSeqWithKey :: (Ord k, Sequence seq) => ([k] -> a -> a -> a) -> seq ([k], a) -> FM k a Source #

insertWith :: Ord k => (a -> a -> a) -> [k] -> a -> FM k a -> FM k a Source #

insertWithKey :: Ord k => ([k] -> a -> a -> a) -> [k] -> a -> FM k a -> FM k a Source #

insertSeqWith :: (Ord k, Sequence seq) => (a -> a -> a) -> seq ([k], a) -> FM k a -> FM k a Source #

insertSeqWithKey :: (Ord k, Sequence seq) => ([k] -> a -> a -> a) -> seq ([k], a) -> FM k a -> FM k a Source #

unionl :: Ord k => FM k a -> FM k a -> FM k a Source #

unionr :: Ord k => FM k a -> FM k a -> FM k a Source #

unionWith :: Ord k => (a -> a -> a) -> FM k a -> FM k a -> FM k a Source #

unionSeqWith :: (Ord k, Sequence seq) => (a -> a -> a) -> seq (FM k a) -> FM k a Source #

intersectionWith :: Ord k => (a -> b -> c) -> FM k a -> FM k b -> FM k c Source #

difference :: Ord k => FM k a -> FM k b -> FM k a Source #

properSubset :: Ord k => FM k a -> FM k b -> Bool Source #

subset :: Ord k => FM k a -> FM k b -> Bool Source #

properSubmapBy :: Ord k => (a -> a -> Bool) -> FM k a -> FM k a -> Bool Source #

submapBy :: Ord k => (a -> a -> Bool) -> FM k a -> FM k a -> Bool Source #

sameMapBy :: Ord k => (a -> a -> Bool) -> FM k a -> FM k a -> Bool Source #

properSubmap :: (Ord k, Eq a) => FM k a -> FM k a -> Bool Source #

submap :: (Ord k, Eq a) => FM k a -> FM k a -> Bool Source #

sameMap :: (Ord k, Eq a) => FM k a -> FM k a -> Bool Source #

FiniteMap operations

unionWithKey :: Ord k => ([k] -> a -> a -> a) -> FM k a -> FM k a -> FM k a Source #

unionSeqWithKey :: (Ord k, Sequence seq) => ([k] -> a -> a -> a) -> seq (FM k a) -> FM k a Source #

intersectionWithKey :: Ord k => ([k] -> a -> b -> c) -> FM k a -> FM k b -> FM k c Source #

OrdAssocX operations

minView :: Monad m => FM k a -> m (a, FM k a) Source #

minElem :: FM t1 t -> t Source #

deleteMin :: Ord k => FM k a -> FM k a Source #

unsafeInsertMin :: Ord k => [k] -> a -> FM k a -> FM k a Source #

maxView :: Monad m => FM k a -> m (a, FM k a) Source #

maxElem :: FM k a -> a Source #

deleteMax :: Ord k => FM k a -> FM k a Source #

unsafeInsertMax :: Ord k => [k] -> a -> FM k a -> FM k a Source #

foldr :: Ord k => (a -> b -> b) -> b -> FM k a -> b Source #

foldr' :: Ord k => (a -> b -> b) -> b -> FM k a -> b Source #

foldr1 :: Ord k => (a -> a -> a) -> FM k a -> a Source #

foldr1' :: Ord k => (a -> a -> a) -> FM k a -> a Source #

foldl :: (a -> b -> a) -> a -> FM t b -> a Source #

foldl' :: (a -> b -> a) -> a -> FM t b -> a Source #

foldl1 :: (b -> b -> b) -> FM k b -> b Source #

foldl1' :: (b -> b -> b) -> FM k b -> b Source #

unsafeFromOrdSeq :: (Ord k, Sequence seq) => seq ([k], a) -> FM k a Source #

unsafeAppend :: Ord k => FM k a -> FM k a -> FM k a Source #

filterLT :: Ord k => [k] -> FM k a -> FM k a Source #

filterLE :: Ord k => [k] -> FM k a -> FM k a Source #

filterGT :: Ord k => [k] -> FM k a -> FM k a Source #

filterGE :: Ord k => [k] -> FM k a -> FM k a Source #

partitionLT_GE :: Ord k => [k] -> FM k a -> (FM k a, FM k a) Source #

partitionLE_GT :: Ord k => [k] -> FM k a -> (FM k a, FM k a) Source #

partitionLT_GT :: Ord k => [k] -> FM k a -> (FM k a, FM k a) Source #

OrdAssoc operations

minViewWithKey :: Monad m => FM k a -> m (([k], a), FM k a) Source #

minElemWithKey :: FM k a -> ([k], a) Source #

maxViewWithKey :: Monad m => FM k a -> m (([k], a), FM k a) Source #

maxElemWithKey :: FM k a -> ([k], a) Source #

foldrWithKey :: Ord k => ([k] -> a -> b -> b) -> b -> FM k a -> b Source #

foldrWithKey' :: Ord k => ([k] -> a -> b -> b) -> b -> FM k a -> b Source #

foldlWithKey :: Ord k => (b -> [k] -> a -> b) -> b -> FM k a -> b Source #

foldlWithKey' :: Ord k => (b -> [k] -> a -> b) -> b -> FM k a -> b Source #

toOrdSeq :: (Ord k, Sequence seq) => FM k a -> seq ([k], a) Source #

Other supported operations

mergeVFM :: Ord k => (Maybe a -> Maybe b -> Maybe c) -> FM k a -> FM k b -> FM k c Source #

mergeKVFM :: Ord k => ([k] -> Maybe a -> Maybe b -> Maybe c) -> FM k a -> FM k b -> FM k c Source #

Documentation