{-# LANGUAGE CPP, MultiParamTypeClasses, FlexibleInstances
, FlexibleContexts, UndecidableInstances #-}
#include "exports.h"
module Data.ListTrie.Set (SET_EXPORTS) where
import Control.Arrow ((***))
import Control.Monad (liftM2)
import Data.Binary (Binary,get,put)
import Data.Function (on)
import qualified Data.List.NonEmpty as NE
import Data.Semigroup (Semigroup(..), stimesIdempotent)
import Prelude hiding (filter, foldl, foldl', foldr, map, null)
import qualified Prelude
#if __GLASGOW_HASKELL__
import Text.Read (readPrec, lexP, parens, prec, Lexeme(Ident))
#endif
import qualified Data.ListTrie.Base as Base
import qualified Data.ListTrie.Base.Map as Map
import Data.ListTrie.Base.Classes (Identity(..), Unwrappable(..))
import Data.ListTrie.Base.Map (Map, OrdMap)
import Data.ListTrie.Util ((.:), (.:.), both)
#include "docs.h"
data TrieSetBase map a bool = Tr !bool !(CMap map a bool)
type CMap map a bool = map a (TrieSetBase map a bool)
newtype TrieSet map a = TS { forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS :: TrieSetBase map a Bool }
inTS :: (TrieSetBase map a Bool -> TrieSetBase nap b Bool)
-> (TrieSet map a -> TrieSet nap b)
inTS :: forall (map :: * -> * -> *) a (nap :: * -> * -> *) b.
(TrieSetBase map a Bool -> TrieSetBase nap b Bool)
-> TrieSet map a -> TrieSet nap b
inTS TrieSetBase map a Bool -> TrieSetBase nap b Bool
f = TrieSetBase nap b Bool -> TrieSet nap b
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS (TrieSetBase nap b Bool -> TrieSet nap b)
-> (TrieSet map a -> TrieSetBase nap b Bool)
-> TrieSet map a
-> TrieSet nap b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSetBase map a Bool -> TrieSetBase nap b Bool
f (TrieSetBase map a Bool -> TrieSetBase nap b Bool)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> TrieSetBase nap b Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
instance Map map k => Base.Trie TrieSetBase Identity map k where
mkTrie :: forall a.
Identity a -> CMap TrieSetBase map k a -> TrieSetBase map k a
mkTrie = a -> CMap map k a -> TrieSetBase map k a
forall (map :: * -> * -> *) a bool.
bool -> CMap map a bool -> TrieSetBase map a bool
Tr (a -> CMap map k a -> TrieSetBase map k a)
-> (Identity a -> a)
-> Identity a
-> CMap map k a
-> TrieSetBase map k a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Identity a -> a
forall a. Identity a -> a
forall (w :: * -> *) a. Unwrappable w => w a -> a
unwrap
tParts :: forall a.
TrieSetBase map k a -> (Identity a, CMap TrieSetBase map k a)
tParts (Tr a
b CMap map k a
m) = (a -> Identity a
forall a. a -> Identity a
Id a
b,CMap map k a
m)
instance Eq (CMap map a Bool) => Eq (TrieSetBase map a Bool) where
Tr Bool
b1 CMap map a Bool
m1 == :: TrieSetBase map a Bool -> TrieSetBase map a Bool -> Bool
== Tr Bool
b2 CMap map a Bool
m2 = Bool
b1 Bool -> Bool -> Bool
forall a. Eq a => a -> a -> Bool
== Bool
b2 Bool -> Bool -> Bool
&& CMap map a Bool
m1 CMap map a Bool -> CMap map a Bool -> Bool
forall a. Eq a => a -> a -> Bool
== CMap map a Bool
m2
instance (Eq (CMap map a Bool), OrdMap map a, Ord a)
=> Ord (TrieSetBase map a Bool)
where
compare :: TrieSetBase map a Bool -> TrieSetBase map a Bool -> Ordering
compare = [([a], Bool)] -> [([a], Bool)] -> Ordering
forall a. Ord a => a -> a -> Ordering
compare ([([a], Bool)] -> [([a], Bool)] -> Ordering)
-> (TrieSetBase map a Bool -> [([a], Bool)])
-> TrieSetBase map a Bool
-> TrieSetBase map a Bool
-> Ordering
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` TrieSetBase map a Bool -> [([a], Bool)]
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Boolable (st a), Trie trie st map k, OrdMap map k) =>
trie map k a -> [([k], a)]
Base.toAscList
instance Eq (CMap map a Bool) => Eq (TrieSet map a) where
== :: TrieSet map a -> TrieSet map a -> Bool
(==) = TrieSetBase map a Bool -> TrieSetBase map a Bool -> Bool
forall a. Eq a => a -> a -> Bool
(==) (TrieSetBase map a Bool -> TrieSetBase map a Bool -> Bool)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> TrieSet map a
-> Bool
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
instance (Eq (CMap map a Bool), OrdMap map a, Ord a) => Ord (TrieSet map a)
where
compare :: TrieSet map a -> TrieSet map a -> Ordering
compare = TrieSetBase map a Bool -> TrieSetBase map a Bool -> Ordering
forall a. Ord a => a -> a -> Ordering
compare (TrieSetBase map a Bool -> TrieSetBase map a Bool -> Ordering)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> TrieSet map a
-> Ordering
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
instance Map map a => Semigroup (TrieSet map a) where
<> :: TrieSet map a -> TrieSet map a -> TrieSet map a
(<>) = TrieSet map a -> TrieSet map a -> TrieSet map a
forall (map :: * -> * -> *) a.
Map map a =>
TrieSet map a -> TrieSet map a -> TrieSet map a
union
sconcat :: NonEmpty (TrieSet map a) -> TrieSet map a
sconcat = [TrieSet map a] -> TrieSet map a
forall (map :: * -> * -> *) a.
Map map a =>
[TrieSet map a] -> TrieSet map a
unions ([TrieSet map a] -> TrieSet map a)
-> (NonEmpty (TrieSet map a) -> [TrieSet map a])
-> NonEmpty (TrieSet map a)
-> TrieSet map a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmpty (TrieSet map a) -> [TrieSet map a]
forall a. NonEmpty a -> [a]
NE.toList
stimes :: forall b. Integral b => b -> TrieSet map a -> TrieSet map a
stimes = b -> TrieSet map a -> TrieSet map a
forall b a. Integral b => b -> a -> a
stimesIdempotent
instance Map map a => Monoid (TrieSet map a) where
mempty :: TrieSet map a
mempty = TrieSet map a
forall (map :: * -> * -> *) a. Map map a => TrieSet map a
empty
mappend :: TrieSet map a -> TrieSet map a -> TrieSet map a
mappend = TrieSet map a -> TrieSet map a -> TrieSet map a
forall a. Semigroup a => a -> a -> a
(<>)
mconcat :: [TrieSet map a] -> TrieSet map a
mconcat = [TrieSet map a] -> TrieSet map a
forall (map :: * -> * -> *) a.
Map map a =>
[TrieSet map a] -> TrieSet map a
unions
instance (Map map a, Show a) => Show (TrieSet map a) where
showsPrec :: Int -> TrieSet map a -> ShowS
showsPrec Int
p TrieSet map a
s = Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
10) (ShowS -> ShowS) -> ShowS -> ShowS
forall a b. (a -> b) -> a -> b
$
String -> ShowS
showString String
"fromList " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[a]] -> ShowS
forall a. Show a => a -> ShowS
shows (TrieSet map a -> [[a]]
forall (map :: * -> * -> *) a. Map map a => TrieSet map a -> [[a]]
toList TrieSet map a
s)
instance (Map map a, Read a) => Read (TrieSet map a) where
#if __GLASGOW_HASKELL__
readPrec :: ReadPrec (TrieSet map a)
readPrec = ReadPrec (TrieSet map a) -> ReadPrec (TrieSet map a)
forall a. ReadPrec a -> ReadPrec a
parens (ReadPrec (TrieSet map a) -> ReadPrec (TrieSet map a))
-> ReadPrec (TrieSet map a) -> ReadPrec (TrieSet map a)
forall a b. (a -> b) -> a -> b
$ Int -> ReadPrec (TrieSet map a) -> ReadPrec (TrieSet map a)
forall a. Int -> ReadPrec a -> ReadPrec a
prec Int
10 (ReadPrec (TrieSet map a) -> ReadPrec (TrieSet map a))
-> ReadPrec (TrieSet map a) -> ReadPrec (TrieSet map a)
forall a b. (a -> b) -> a -> b
$ do
Ident String
"fromList" <- ReadPrec Lexeme
lexP
([[a]] -> TrieSet map a)
-> ReadPrec [[a]] -> ReadPrec (TrieSet map a)
forall a b. (a -> b) -> ReadPrec a -> ReadPrec b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap [[a]] -> TrieSet map a
forall (map :: * -> * -> *) a. Map map a => [[a]] -> TrieSet map a
fromList ReadPrec [[a]]
forall a. Read a => ReadPrec a
readPrec
#else
readsPrec p = readParen (p > 10) $ \r -> do
("fromList", list) <- lex r
(xs, rest) <- readsPrec (p+1) list
[(fromList xs, rest)]
#endif
instance (Map map k, Binary k, Binary a) => Binary (TrieSetBase map k a) where
put :: TrieSetBase map k a -> Put
put (Tr a
v CMap map k a
m) = a -> Put
forall t. Binary t => t -> Put
put a
v Put -> Put -> Put
forall a b. PutM a -> PutM b -> PutM b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> ([(k, TrieSetBase map k a)] -> Put
forall t. Binary t => t -> Put
put ([(k, TrieSetBase map k a)] -> Put)
-> (CMap map k a -> [(k, TrieSetBase map k a)])
-> CMap map k a
-> Put
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CMap map k a -> [(k, TrieSetBase map k a)]
forall a. map k a -> [(k, a)]
forall (m :: * -> * -> *) k a. Map m k => m k a -> [(k, a)]
Map.serializeToList (CMap map k a -> Put) -> CMap map k a -> Put
forall a b. (a -> b) -> a -> b
$ CMap map k a
m)
get :: Get (TrieSetBase map k a)
get = (a -> CMap map k a -> TrieSetBase map k a)
-> Get a -> Get (CMap map k a) -> Get (TrieSetBase map k a)
forall (m :: * -> *) a1 a2 r.
Monad m =>
(a1 -> a2 -> r) -> m a1 -> m a2 -> m r
liftM2 a -> CMap map k a -> TrieSetBase map k a
forall (map :: * -> * -> *) a bool.
bool -> CMap map a bool -> TrieSetBase map a bool
Tr Get a
forall t. Binary t => Get t
get (Get [(k, TrieSetBase map k a)]
forall t. Binary t => Get t
get Get [(k, TrieSetBase map k a)]
-> ([(k, TrieSetBase map k a)] -> Get (CMap map k a))
-> Get (CMap map k a)
forall a b. Get a -> (a -> Get b) -> Get b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= CMap map k a -> Get (CMap map k a)
forall a. a -> Get a
forall (m :: * -> *) a. Monad m => a -> m a
return (CMap map k a -> Get (CMap map k a))
-> ([(k, TrieSetBase map k a)] -> CMap map k a)
-> [(k, TrieSetBase map k a)]
-> Get (CMap map k a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [(k, TrieSetBase map k a)] -> CMap map k a
forall a. [(k, a)] -> map k a
forall (m :: * -> * -> *) k a. Map m k => [(k, a)] -> m k a
Map.deserializeFromList)
instance (Map map a, Binary a) => Binary (TrieSet map a) where
put :: TrieSet map a -> Put
put = TrieSetBase map a Bool -> Put
forall t. Binary t => t -> Put
put (TrieSetBase map a Bool -> Put)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> Put
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
get :: Get (TrieSet map a)
get = Get (TrieSetBase map a Bool)
forall t. Binary t => Get t
get Get (TrieSetBase map a Bool)
-> (TrieSetBase map a Bool -> Get (TrieSet map a))
-> Get (TrieSet map a)
forall a b. Get a -> (a -> Get b) -> Get b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= TrieSet map a -> Get (TrieSet map a)
forall a. a -> Get a
forall (m :: * -> *) a. Monad m => a -> m a
return (TrieSet map a -> Get (TrieSet map a))
-> (TrieSetBase map a Bool -> TrieSet map a)
-> TrieSetBase map a Bool
-> Get (TrieSet map a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS
empty :: Map map a => TrieSet map a
empty :: forall (map :: * -> * -> *) a. Map map a => TrieSet map a
empty = TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS TrieSetBase map a Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Trie trie st map k) =>
trie map k a
Base.empty
singleton :: Map map a => [a] -> TrieSet map a
singleton :: forall (map :: * -> * -> *) a. Map map a => [a] -> TrieSet map a
singleton [a]
k = TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS(TrieSetBase map a Bool -> TrieSet map a)
-> TrieSetBase map a Bool -> TrieSet map a
forall a b. (a -> b) -> a -> b
$ [a] -> Bool -> TrieSetBase map a Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Trie trie st map k) =>
[k] -> a -> trie map k a
Base.singleton [a]
k Bool
True
insert :: Map map a => [a] -> TrieSet map a -> TrieSet map a
insert :: forall (map :: * -> * -> *) a.
Map map a =>
[a] -> TrieSet map a -> TrieSet map a
insert [a]
k = (TrieSetBase map a Bool -> TrieSetBase map a Bool)
-> TrieSet map a -> TrieSet map a
forall (map :: * -> * -> *) a (nap :: * -> * -> *) b.
(TrieSetBase map a Bool -> TrieSetBase nap b Bool)
-> TrieSet map a -> TrieSet nap b
inTS((TrieSetBase map a Bool -> TrieSetBase map a Bool)
-> TrieSet map a -> TrieSet map a)
-> (TrieSetBase map a Bool -> TrieSetBase map a Bool)
-> TrieSet map a
-> TrieSet map a
forall a b. (a -> b) -> a -> b
$ [a] -> Bool -> TrieSetBase map a Bool -> TrieSetBase map a Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Trie trie st map k) =>
[k] -> a -> trie map k a -> trie map k a
Base.insert [a]
k Bool
True
delete :: Map map a => [a] -> TrieSet map a -> TrieSet map a
delete :: forall (map :: * -> * -> *) a.
Map map a =>
[a] -> TrieSet map a -> TrieSet map a
delete = (TrieSetBase map a Bool -> TrieSetBase map a Bool)
-> TrieSet map a -> TrieSet map a
forall (map :: * -> * -> *) a (nap :: * -> * -> *) b.
(TrieSetBase map a Bool -> TrieSetBase nap b Bool)
-> TrieSet map a -> TrieSet nap b
inTS ((TrieSetBase map a Bool -> TrieSetBase map a Bool)
-> TrieSet map a -> TrieSet map a)
-> ([a] -> TrieSetBase map a Bool -> TrieSetBase map a Bool)
-> [a]
-> TrieSet map a
-> TrieSet map a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [a] -> TrieSetBase map a Bool -> TrieSetBase map a Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Boolable (st a), Trie trie st map k) =>
[k] -> trie map k a -> trie map k a
Base.delete
null :: Map map a => TrieSet map a -> Bool
null :: forall (map :: * -> * -> *) a. Map map a => TrieSet map a -> Bool
null = TrieSetBase map a Bool -> Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Boolable (st a), Trie trie st map k) =>
trie map k a -> Bool
Base.null (TrieSetBase map a Bool -> Bool)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
size :: (Map map a, Num n) => TrieSet map a -> n
size :: forall (map :: * -> * -> *) a n.
(Map map a, Num n) =>
TrieSet map a -> n
size = TrieSetBase map a Bool -> n
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k n.
(Boolable (st a), Trie trie st map k, Num n) =>
trie map k a -> n
Base.size (TrieSetBase map a Bool -> n)
-> (TrieSet map a -> TrieSetBase map a Bool) -> TrieSet map a -> n
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
size' :: (Map map a, Num n) => TrieSet map a -> n
size' :: forall (map :: * -> * -> *) a n.
(Map map a, Num n) =>
TrieSet map a -> n
size' = TrieSetBase map a Bool -> n
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k n.
(Boolable (st a), Trie trie st map k, Num n) =>
trie map k a -> n
Base.size' (TrieSetBase map a Bool -> n)
-> (TrieSet map a -> TrieSetBase map a Bool) -> TrieSet map a -> n
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
member :: Map map a => [a] -> TrieSet map a -> Bool
member :: forall (map :: * -> * -> *) a.
Map map a =>
[a] -> TrieSet map a -> Bool
member = [a] -> TrieSetBase map a Bool -> Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Boolable (st a), Trie trie st map k) =>
[k] -> trie map k a -> Bool
Base.member ([a] -> TrieSetBase map a Bool -> Bool)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> [a]
-> TrieSet map a
-> Bool
forall a b c d. (a -> b -> c) -> (d -> b) -> a -> d -> c
.:. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
notMember :: Map map a => [a] -> TrieSet map a -> Bool
notMember :: forall (map :: * -> * -> *) a.
Map map a =>
[a] -> TrieSet map a -> Bool
notMember = [a] -> TrieSetBase map a Bool -> Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Boolable (st a), Trie trie st map k) =>
[k] -> trie map k a -> Bool
Base.notMember ([a] -> TrieSetBase map a Bool -> Bool)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> [a]
-> TrieSet map a
-> Bool
forall a b c d. (a -> b -> c) -> (d -> b) -> a -> d -> c
.:. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
isSubsetOf :: Map map a => TrieSet map a -> TrieSet map a -> Bool
isSubsetOf :: forall (map :: * -> * -> *) a.
Map map a =>
TrieSet map a -> TrieSet map a -> Bool
isSubsetOf = (Bool -> Bool -> Bool)
-> TrieSetBase map a Bool -> TrieSetBase map a Bool -> Bool
forall (st :: * -> *) a b (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Boolable (st a), Boolable (st b), Trie trie st map k) =>
(a -> b -> Bool) -> trie map k a -> trie map k b -> Bool
Base.isSubmapOfBy Bool -> Bool -> Bool
(&&) (TrieSetBase map a Bool -> TrieSetBase map a Bool -> Bool)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> TrieSet map a
-> Bool
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
isProperSubsetOf :: Map map a => TrieSet map a -> TrieSet map a -> Bool
isProperSubsetOf :: forall (map :: * -> * -> *) a.
Map map a =>
TrieSet map a -> TrieSet map a -> Bool
isProperSubsetOf = (Bool -> Bool -> Bool)
-> TrieSetBase map a Bool -> TrieSetBase map a Bool -> Bool
forall (st :: * -> *) a b (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Boolable (st a), Boolable (st b), Trie trie st map k) =>
(a -> b -> Bool) -> trie map k a -> trie map k b -> Bool
Base.isProperSubmapOfBy Bool -> Bool -> Bool
(&&) (TrieSetBase map a Bool -> TrieSetBase map a Bool -> Bool)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> TrieSet map a
-> Bool
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
defaultUnion :: Bool -> Bool -> Bool
defaultUnion :: Bool -> Bool -> Bool
defaultUnion = String -> Bool -> Bool -> Bool
forall a. HasCallStack => String -> a
error String
"TrieSet.union :: internal error"
union :: Map map a => TrieSet map a -> TrieSet map a -> TrieSet map a
union :: forall (map :: * -> * -> *) a.
Map map a =>
TrieSet map a -> TrieSet map a -> TrieSet map a
union = TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS (TrieSetBase map a Bool -> TrieSet map a)
-> (TrieSetBase map a Bool
-> TrieSetBase map a Bool -> TrieSetBase map a Bool)
-> TrieSetBase map a Bool
-> TrieSetBase map a Bool
-> TrieSet map a
forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d
.: (Bool -> Bool -> Bool)
-> TrieSetBase map a Bool
-> TrieSetBase map a Bool
-> TrieSetBase map a Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Unionable st a, Trie trie st map k) =>
(a -> a -> a) -> trie map k a -> trie map k a -> trie map k a
Base.unionWith Bool -> Bool -> Bool
defaultUnion (TrieSetBase map a Bool -> TrieSetBase map a Bool -> TrieSet map a)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> TrieSet map a
-> TrieSet map a
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
unions :: Map map a => [TrieSet map a] -> TrieSet map a
unions :: forall (map :: * -> * -> *) a.
Map map a =>
[TrieSet map a] -> TrieSet map a
unions = TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS (TrieSetBase map a Bool -> TrieSet map a)
-> ([TrieSet map a] -> TrieSetBase map a Bool)
-> [TrieSet map a]
-> TrieSet map a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Bool -> Bool -> Bool)
-> [TrieSetBase map a Bool] -> TrieSetBase map a Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Unionable st a, Trie trie st map k) =>
(a -> a -> a) -> [trie map k a] -> trie map k a
Base.unionsWith Bool -> Bool -> Bool
defaultUnion ([TrieSetBase map a Bool] -> TrieSetBase map a Bool)
-> ([TrieSet map a] -> [TrieSetBase map a Bool])
-> [TrieSet map a]
-> TrieSetBase map a Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (TrieSet map a -> TrieSetBase map a Bool)
-> [TrieSet map a] -> [TrieSetBase map a Bool]
forall a b. (a -> b) -> [a] -> [b]
Prelude.map TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
difference :: Map map a => TrieSet map a -> TrieSet map a -> TrieSet map a
difference :: forall (map :: * -> * -> *) a.
Map map a =>
TrieSet map a -> TrieSet map a -> TrieSet map a
difference = TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS (TrieSetBase map a Bool -> TrieSet map a)
-> (TrieSetBase map a Bool
-> TrieSetBase map a Bool -> TrieSetBase map a Bool)
-> TrieSetBase map a Bool
-> TrieSetBase map a Bool
-> TrieSet map a
forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d
.: (Bool -> Bool -> Maybe Bool)
-> TrieSetBase map a Bool
-> TrieSetBase map a Bool
-> TrieSetBase map a Bool
forall (st :: * -> *) a b (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Boolable (st a), Differentiable st a b, Trie trie st map k) =>
(a -> b -> Maybe a) -> trie map k a -> trie map k b -> trie map k a
Base.differenceWith
(String -> Bool -> Bool -> Maybe Bool
forall a. HasCallStack => String -> a
error String
"TrieSet.difference :: internal error")
(TrieSetBase map a Bool -> TrieSetBase map a Bool -> TrieSet map a)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> TrieSet map a
-> TrieSet map a
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
intersection :: Map map a => TrieSet map a -> TrieSet map a -> TrieSet map a
intersection :: forall (map :: * -> * -> *) a.
Map map a =>
TrieSet map a -> TrieSet map a -> TrieSet map a
intersection = TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS (TrieSetBase map a Bool -> TrieSet map a)
-> (TrieSetBase map a Bool
-> TrieSetBase map a Bool -> TrieSetBase map a Bool)
-> TrieSetBase map a Bool
-> TrieSetBase map a Bool
-> TrieSet map a
forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d
.: (Bool -> Bool -> Bool)
-> TrieSetBase map a Bool
-> TrieSetBase map a Bool
-> TrieSetBase map a Bool
forall (st :: * -> *) c a b (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Boolable (st c), Intersectable st a b c, Trie trie st map k) =>
(a -> b -> c) -> trie map k a -> trie map k b -> trie map k c
Base.intersectionWith
(String -> Bool -> Bool -> Bool
forall a. HasCallStack => String -> a
error String
"TrieSet.intersection :: internal error")
(TrieSetBase map a Bool -> TrieSetBase map a Bool -> TrieSet map a)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> TrieSet map a
-> TrieSet map a
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
filter :: Map map a => ([a] -> Bool) -> TrieSet map a -> TrieSet map a
filter :: forall (map :: * -> * -> *) a.
Map map a =>
([a] -> Bool) -> TrieSet map a -> TrieSet map a
filter [a] -> Bool
p = (TrieSetBase map a Bool -> TrieSetBase map a Bool)
-> TrieSet map a -> TrieSet map a
forall (map :: * -> * -> *) a (nap :: * -> * -> *) b.
(TrieSetBase map a Bool -> TrieSetBase nap b Bool)
-> TrieSet map a -> TrieSet nap b
inTS ((TrieSetBase map a Bool -> TrieSetBase map a Bool)
-> TrieSet map a -> TrieSet map a)
-> (TrieSetBase map a Bool -> TrieSetBase map a Bool)
-> TrieSet map a
-> TrieSet map a
forall a b. (a -> b) -> a -> b
$ ([a] -> Bool -> Bool)
-> TrieSetBase map a Bool -> TrieSetBase map a Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Boolable (st a), Trie trie st map k) =>
([k] -> a -> Bool) -> trie map k a -> trie map k a
Base.filterWithKey (\[a]
k Bool
_ -> [a] -> Bool
p [a]
k)
partition :: Map map a
=> ([a] -> Bool) -> TrieSet map a -> (TrieSet map a, TrieSet map a)
partition :: forall (map :: * -> * -> *) a.
Map map a =>
([a] -> Bool) -> TrieSet map a -> (TrieSet map a, TrieSet map a)
partition [a] -> Bool
p = (TrieSetBase map a Bool -> TrieSet map a)
-> (TrieSetBase map a Bool, TrieSetBase map a Bool)
-> (TrieSet map a, TrieSet map a)
forall a b. (a -> b) -> (a, a) -> (b, b)
both TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS ((TrieSetBase map a Bool, TrieSetBase map a Bool)
-> (TrieSet map a, TrieSet map a))
-> (TrieSet map a
-> (TrieSetBase map a Bool, TrieSetBase map a Bool))
-> TrieSet map a
-> (TrieSet map a, TrieSet map a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([a] -> Bool -> Bool)
-> TrieSetBase map a Bool
-> (TrieSetBase map a Bool, TrieSetBase map a Bool)
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Boolable (st a), Trie trie st map k) =>
([k] -> a -> Bool) -> trie map k a -> (trie map k a, trie map k a)
Base.partitionWithKey (\[a]
k Bool
_ -> [a] -> Bool
p [a]
k) (TrieSetBase map a Bool
-> (TrieSetBase map a Bool, TrieSetBase map a Bool))
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> (TrieSetBase map a Bool, TrieSetBase map a Bool)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
map :: (Map map a, Map map b) => ([a] -> [b]) -> TrieSet map a -> TrieSet map b
map :: forall (map :: * -> * -> *) a b.
(Map map a, Map map b) =>
([a] -> [b]) -> TrieSet map a -> TrieSet map b
map = (TrieSetBase map a Bool -> TrieSetBase map b Bool)
-> TrieSet map a -> TrieSet map b
forall (map :: * -> * -> *) a (nap :: * -> * -> *) b.
(TrieSetBase map a Bool -> TrieSetBase nap b Bool)
-> TrieSet map a -> TrieSet nap b
inTS ((TrieSetBase map a Bool -> TrieSetBase map b Bool)
-> TrieSet map a -> TrieSet map b)
-> (([a] -> [b])
-> TrieSetBase map a Bool -> TrieSetBase map b Bool)
-> ([a] -> [b])
-> TrieSet map a
-> TrieSet map b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([([b], Bool)] -> TrieSetBase map b Bool)
-> ([a] -> [b]) -> TrieSetBase map a Bool -> TrieSetBase map b Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k1 k2.
(Boolable (st a), Trie trie st map k1, Trie trie st map k2) =>
([([k2], a)] -> trie map k2 a)
-> ([k1] -> [k2]) -> trie map k1 a -> trie map k2 a
Base.mapKeysWith [([b], Bool)] -> TrieSetBase map b Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Trie trie st map k) =>
[([k], a)] -> trie map k a
Base.fromList
mapIn :: (Map map a, Map map b) => (a -> b) -> TrieSet map a -> TrieSet map b
mapIn :: forall (map :: * -> * -> *) a b.
(Map map a, Map map b) =>
(a -> b) -> TrieSet map a -> TrieSet map b
mapIn = (TrieSetBase map a Bool -> TrieSetBase map b Bool)
-> TrieSet map a -> TrieSet map b
forall (map :: * -> * -> *) a (nap :: * -> * -> *) b.
(TrieSetBase map a Bool -> TrieSetBase nap b Bool)
-> TrieSet map a -> TrieSet nap b
inTS ((TrieSetBase map a Bool -> TrieSetBase map b Bool)
-> TrieSet map a -> TrieSet map b)
-> ((a -> b) -> TrieSetBase map a Bool -> TrieSetBase map b Bool)
-> (a -> b)
-> TrieSet map a
-> TrieSet map b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Bool -> Bool -> Bool)
-> (a -> b) -> TrieSetBase map a Bool -> TrieSetBase map b Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k1 k2.
(Unionable st a, Trie trie st map k1, Trie trie st map k2) =>
(a -> a -> a) -> (k1 -> k2) -> trie map k1 a -> trie map k2 a
Base.mapInKeysWith Bool -> Bool -> Bool
defaultUnion
foldr :: Map map a => ([a] -> b -> b) -> b -> TrieSet map a -> b
foldr :: forall (map :: * -> * -> *) a b.
Map map a =>
([a] -> b -> b) -> b -> TrieSet map a -> b
foldr [a] -> b -> b
f = ([a] -> Bool -> b -> b) -> b -> TrieSetBase map a Bool -> b
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k b.
(Boolable (st a), Trie trie st map k) =>
([k] -> a -> b -> b) -> b -> trie map k a -> b
Base.foldrWithKey (\[a]
k Bool
_ -> [a] -> b -> b
f [a]
k) (b -> TrieSetBase map a Bool -> b)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> b
-> TrieSet map a
-> b
forall a b c d. (a -> b -> c) -> (d -> b) -> a -> d -> c
.:. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
foldrAsc :: OrdMap map a => ([a] -> b -> b) -> b -> TrieSet map a -> b
foldrAsc :: forall (map :: * -> * -> *) a b.
OrdMap map a =>
([a] -> b -> b) -> b -> TrieSet map a -> b
foldrAsc [a] -> b -> b
f = ([a] -> Bool -> b -> b) -> b -> TrieSetBase map a Bool -> b
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k b.
(Boolable (st a), Trie trie st map k, OrdMap map k) =>
([k] -> a -> b -> b) -> b -> trie map k a -> b
Base.foldrAscWithKey (\[a]
k Bool
_ -> [a] -> b -> b
f [a]
k) (b -> TrieSetBase map a Bool -> b)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> b
-> TrieSet map a
-> b
forall a b c d. (a -> b -> c) -> (d -> b) -> a -> d -> c
.:. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
foldrDesc :: OrdMap map a => ([a] -> b -> b) -> b -> TrieSet map a -> b
foldrDesc :: forall (map :: * -> * -> *) a b.
OrdMap map a =>
([a] -> b -> b) -> b -> TrieSet map a -> b
foldrDesc [a] -> b -> b
f = ([a] -> Bool -> b -> b) -> b -> TrieSetBase map a Bool -> b
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k b.
(Boolable (st a), Trie trie st map k, OrdMap map k) =>
([k] -> a -> b -> b) -> b -> trie map k a -> b
Base.foldrDescWithKey (\[a]
k Bool
_ -> [a] -> b -> b
f [a]
k) (b -> TrieSetBase map a Bool -> b)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> b
-> TrieSet map a
-> b
forall a b c d. (a -> b -> c) -> (d -> b) -> a -> d -> c
.:. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
foldl :: Map map a => ([a] -> b -> b) -> b -> TrieSet map a -> b
foldl :: forall (map :: * -> * -> *) a b.
Map map a =>
([a] -> b -> b) -> b -> TrieSet map a -> b
foldl [a] -> b -> b
f = ([a] -> Bool -> b -> b) -> b -> TrieSetBase map a Bool -> b
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k b.
(Boolable (st a), Trie trie st map k) =>
([k] -> a -> b -> b) -> b -> trie map k a -> b
Base.foldlWithKey (\[a]
k Bool
_ -> [a] -> b -> b
f [a]
k) (b -> TrieSetBase map a Bool -> b)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> b
-> TrieSet map a
-> b
forall a b c d. (a -> b -> c) -> (d -> b) -> a -> d -> c
.:. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
foldlAsc :: OrdMap map a => ([a] -> b -> b) -> b -> TrieSet map a -> b
foldlAsc :: forall (map :: * -> * -> *) a b.
OrdMap map a =>
([a] -> b -> b) -> b -> TrieSet map a -> b
foldlAsc [a] -> b -> b
f = ([a] -> Bool -> b -> b) -> b -> TrieSetBase map a Bool -> b
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k b.
(Boolable (st a), Trie trie st map k, OrdMap map k) =>
([k] -> a -> b -> b) -> b -> trie map k a -> b
Base.foldlAscWithKey (\[a]
k Bool
_ -> [a] -> b -> b
f [a]
k) (b -> TrieSetBase map a Bool -> b)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> b
-> TrieSet map a
-> b
forall a b c d. (a -> b -> c) -> (d -> b) -> a -> d -> c
.:. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
foldlDesc :: OrdMap map a => ([a] -> b -> b) -> b -> TrieSet map a -> b
foldlDesc :: forall (map :: * -> * -> *) a b.
OrdMap map a =>
([a] -> b -> b) -> b -> TrieSet map a -> b
foldlDesc [a] -> b -> b
f = ([a] -> Bool -> b -> b) -> b -> TrieSetBase map a Bool -> b
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k b.
(Boolable (st a), Trie trie st map k, OrdMap map k) =>
([k] -> a -> b -> b) -> b -> trie map k a -> b
Base.foldlDescWithKey (\[a]
k Bool
_ -> [a] -> b -> b
f [a]
k) (b -> TrieSetBase map a Bool -> b)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> b
-> TrieSet map a
-> b
forall a b c d. (a -> b -> c) -> (d -> b) -> a -> d -> c
.:. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
foldl' :: Map map a => ([a] -> b -> b) -> b -> TrieSet map a -> b
foldl' :: forall (map :: * -> * -> *) a b.
Map map a =>
([a] -> b -> b) -> b -> TrieSet map a -> b
foldl' [a] -> b -> b
f = ([a] -> Bool -> b -> b) -> b -> TrieSetBase map a Bool -> b
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k b.
(Boolable (st a), Trie trie st map k) =>
([k] -> a -> b -> b) -> b -> trie map k a -> b
Base.foldlWithKey' (\[a]
k Bool
_ -> [a] -> b -> b
f [a]
k) (b -> TrieSetBase map a Bool -> b)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> b
-> TrieSet map a
-> b
forall a b c d. (a -> b -> c) -> (d -> b) -> a -> d -> c
.:. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
foldlAsc' :: OrdMap map a => ([a] -> b -> b) -> b -> TrieSet map a -> b
foldlAsc' :: forall (map :: * -> * -> *) a b.
OrdMap map a =>
([a] -> b -> b) -> b -> TrieSet map a -> b
foldlAsc' [a] -> b -> b
f = ([a] -> Bool -> b -> b) -> b -> TrieSetBase map a Bool -> b
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k b.
(Boolable (st a), Trie trie st map k, OrdMap map k) =>
([k] -> a -> b -> b) -> b -> trie map k a -> b
Base.foldlAscWithKey' (\[a]
k Bool
_ -> [a] -> b -> b
f [a]
k) (b -> TrieSetBase map a Bool -> b)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> b
-> TrieSet map a
-> b
forall a b c d. (a -> b -> c) -> (d -> b) -> a -> d -> c
.:. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
foldlDesc' :: OrdMap map a => ([a] -> b -> b) -> b -> TrieSet map a -> b
foldlDesc' :: forall (map :: * -> * -> *) a b.
OrdMap map a =>
([a] -> b -> b) -> b -> TrieSet map a -> b
foldlDesc' [a] -> b -> b
f = ([a] -> Bool -> b -> b) -> b -> TrieSetBase map a Bool -> b
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k b.
(Boolable (st a), Trie trie st map k, OrdMap map k) =>
([k] -> a -> b -> b) -> b -> trie map k a -> b
Base.foldlDescWithKey' (\[a]
k Bool
_ -> [a] -> b -> b
f [a]
k) (b -> TrieSetBase map a Bool -> b)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> b
-> TrieSet map a
-> b
forall a b c d. (a -> b -> c) -> (d -> b) -> a -> d -> c
.:. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
toList :: Map map a => TrieSet map a -> [[a]]
toList :: forall (map :: * -> * -> *) a. Map map a => TrieSet map a -> [[a]]
toList = (([a], Bool) -> [a]) -> [([a], Bool)] -> [[a]]
forall a b. (a -> b) -> [a] -> [b]
Prelude.map ([a], Bool) -> [a]
forall a b. (a, b) -> a
fst ([([a], Bool)] -> [[a]])
-> (TrieSet map a -> [([a], Bool)]) -> TrieSet map a -> [[a]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSetBase map a Bool -> [([a], Bool)]
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Boolable (st a), Trie trie st map k) =>
trie map k a -> [([k], a)]
Base.toList (TrieSetBase map a Bool -> [([a], Bool)])
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> [([a], Bool)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
toAscList :: OrdMap map a => TrieSet map a -> [[a]]
toAscList :: forall (map :: * -> * -> *) a.
OrdMap map a =>
TrieSet map a -> [[a]]
toAscList = (([a], Bool) -> [a]) -> [([a], Bool)] -> [[a]]
forall a b. (a -> b) -> [a] -> [b]
Prelude.map ([a], Bool) -> [a]
forall a b. (a, b) -> a
fst ([([a], Bool)] -> [[a]])
-> (TrieSet map a -> [([a], Bool)]) -> TrieSet map a -> [[a]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSetBase map a Bool -> [([a], Bool)]
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Boolable (st a), Trie trie st map k, OrdMap map k) =>
trie map k a -> [([k], a)]
Base.toAscList (TrieSetBase map a Bool -> [([a], Bool)])
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> [([a], Bool)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
toDescList :: OrdMap map a => TrieSet map a -> [[a]]
toDescList :: forall (map :: * -> * -> *) a.
OrdMap map a =>
TrieSet map a -> [[a]]
toDescList = (([a], Bool) -> [a]) -> [([a], Bool)] -> [[a]]
forall a b. (a -> b) -> [a] -> [b]
Prelude.map ([a], Bool) -> [a]
forall a b. (a, b) -> a
fst ([([a], Bool)] -> [[a]])
-> (TrieSet map a -> [([a], Bool)]) -> TrieSet map a -> [[a]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSetBase map a Bool -> [([a], Bool)]
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Boolable (st a), Trie trie st map k, OrdMap map k) =>
trie map k a -> [([k], a)]
Base.toDescList (TrieSetBase map a Bool -> [([a], Bool)])
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> [([a], Bool)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
fromList :: Map map a => [[a]] -> TrieSet map a
fromList :: forall (map :: * -> * -> *) a. Map map a => [[a]] -> TrieSet map a
fromList = TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS (TrieSetBase map a Bool -> TrieSet map a)
-> ([[a]] -> TrieSetBase map a Bool) -> [[a]] -> TrieSet map a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [([a], Bool)] -> TrieSetBase map a Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Trie trie st map k) =>
[([k], a)] -> trie map k a
Base.fromList ([([a], Bool)] -> TrieSetBase map a Bool)
-> ([[a]] -> [([a], Bool)]) -> [[a]] -> TrieSetBase map a Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([a] -> ([a], Bool)) -> [[a]] -> [([a], Bool)]
forall a b. (a -> b) -> [a] -> [b]
Prelude.map (([a] -> Bool -> ([a], Bool)) -> Bool -> [a] -> ([a], Bool)
forall a b c. (a -> b -> c) -> b -> a -> c
flip (,) Bool
True)
minView :: OrdMap map a => TrieSet map a -> (Maybe [a], TrieSet map a)
minView :: forall (map :: * -> * -> *) a.
OrdMap map a =>
TrieSet map a -> (Maybe [a], TrieSet map a)
minView = ((([a], Bool) -> [a]) -> Maybe ([a], Bool) -> Maybe [a]
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ([a], Bool) -> [a]
forall a b. (a, b) -> a
fst (Maybe ([a], Bool) -> Maybe [a])
-> (TrieSetBase map a Bool -> TrieSet map a)
-> (Maybe ([a], Bool), TrieSetBase map a Bool)
-> (Maybe [a], TrieSet map a)
forall b c b' c'. (b -> c) -> (b' -> c') -> (b, b') -> (c, c')
forall (a :: * -> * -> *) b c b' c'.
Arrow a =>
a b c -> a b' c' -> a (b, b') (c, c')
*** TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS) ((Maybe ([a], Bool), TrieSetBase map a Bool)
-> (Maybe [a], TrieSet map a))
-> (TrieSet map a -> (Maybe ([a], Bool), TrieSetBase map a Bool))
-> TrieSet map a
-> (Maybe [a], TrieSet map a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSetBase map a Bool
-> (Maybe ([a], Bool), TrieSetBase map a Bool)
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Boolable (st a), Trie trie st map k, OrdMap map k) =>
trie map k a -> (Maybe ([k], a), trie map k a)
Base.minView (TrieSetBase map a Bool
-> (Maybe ([a], Bool), TrieSetBase map a Bool))
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> (Maybe ([a], Bool), TrieSetBase map a Bool)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
maxView :: OrdMap map a => TrieSet map a -> (Maybe [a], TrieSet map a)
maxView :: forall (map :: * -> * -> *) a.
OrdMap map a =>
TrieSet map a -> (Maybe [a], TrieSet map a)
maxView = ((([a], Bool) -> [a]) -> Maybe ([a], Bool) -> Maybe [a]
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ([a], Bool) -> [a]
forall a b. (a, b) -> a
fst (Maybe ([a], Bool) -> Maybe [a])
-> (TrieSetBase map a Bool -> TrieSet map a)
-> (Maybe ([a], Bool), TrieSetBase map a Bool)
-> (Maybe [a], TrieSet map a)
forall b c b' c'. (b -> c) -> (b' -> c') -> (b, b') -> (c, c')
forall (a :: * -> * -> *) b c b' c'.
Arrow a =>
a b c -> a b' c' -> a (b, b') (c, c')
*** TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS) ((Maybe ([a], Bool), TrieSetBase map a Bool)
-> (Maybe [a], TrieSet map a))
-> (TrieSet map a -> (Maybe ([a], Bool), TrieSetBase map a Bool))
-> TrieSet map a
-> (Maybe [a], TrieSet map a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSetBase map a Bool
-> (Maybe ([a], Bool), TrieSetBase map a Bool)
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Boolable (st a), Trie trie st map k, OrdMap map k) =>
trie map k a -> (Maybe ([k], a), trie map k a)
Base.maxView (TrieSetBase map a Bool
-> (Maybe ([a], Bool), TrieSetBase map a Bool))
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> (Maybe ([a], Bool), TrieSetBase map a Bool)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
findMin :: OrdMap map a => TrieSet map a -> Maybe [a]
findMin :: forall (map :: * -> * -> *) a.
OrdMap map a =>
TrieSet map a -> Maybe [a]
findMin = (([a], Bool) -> [a]) -> Maybe ([a], Bool) -> Maybe [a]
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ([a], Bool) -> [a]
forall a b. (a, b) -> a
fst (Maybe ([a], Bool) -> Maybe [a])
-> (TrieSet map a -> Maybe ([a], Bool))
-> TrieSet map a
-> Maybe [a]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSetBase map a Bool -> Maybe ([a], Bool)
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Boolable (st a), Trie trie st map k, OrdMap map k) =>
trie map k a -> Maybe ([k], a)
Base.findMin (TrieSetBase map a Bool -> Maybe ([a], Bool))
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> Maybe ([a], Bool)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
findMax :: OrdMap map a => TrieSet map a -> Maybe [a]
findMax :: forall (map :: * -> * -> *) a.
OrdMap map a =>
TrieSet map a -> Maybe [a]
findMax = (([a], Bool) -> [a]) -> Maybe ([a], Bool) -> Maybe [a]
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ([a], Bool) -> [a]
forall a b. (a, b) -> a
fst (Maybe ([a], Bool) -> Maybe [a])
-> (TrieSet map a -> Maybe ([a], Bool))
-> TrieSet map a
-> Maybe [a]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSetBase map a Bool -> Maybe ([a], Bool)
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Boolable (st a), Trie trie st map k, OrdMap map k) =>
trie map k a -> Maybe ([k], a)
Base.findMax (TrieSetBase map a Bool -> Maybe ([a], Bool))
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> Maybe ([a], Bool)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
deleteMin :: OrdMap map a => TrieSet map a -> TrieSet map a
deleteMin :: forall (map :: * -> * -> *) a.
OrdMap map a =>
TrieSet map a -> TrieSet map a
deleteMin = (TrieSetBase map a Bool -> TrieSetBase map a Bool)
-> TrieSet map a -> TrieSet map a
forall (map :: * -> * -> *) a (nap :: * -> * -> *) b.
(TrieSetBase map a Bool -> TrieSetBase nap b Bool)
-> TrieSet map a -> TrieSet nap b
inTS TrieSetBase map a Bool -> TrieSetBase map a Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Boolable (st a), Trie trie st map k, OrdMap map k) =>
trie map k a -> trie map k a
Base.deleteMin
deleteMax :: OrdMap map a => TrieSet map a -> TrieSet map a
deleteMax :: forall (map :: * -> * -> *) a.
OrdMap map a =>
TrieSet map a -> TrieSet map a
deleteMax = (TrieSetBase map a Bool -> TrieSetBase map a Bool)
-> TrieSet map a -> TrieSet map a
forall (map :: * -> * -> *) a (nap :: * -> * -> *) b.
(TrieSetBase map a Bool -> TrieSetBase nap b Bool)
-> TrieSet map a -> TrieSet nap b
inTS TrieSetBase map a Bool -> TrieSetBase map a Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Boolable (st a), Trie trie st map k, OrdMap map k) =>
trie map k a -> trie map k a
Base.deleteMax
split :: OrdMap map a => [a] -> TrieSet map a -> (TrieSet map a, TrieSet map a)
split :: forall (map :: * -> * -> *) a.
OrdMap map a =>
[a] -> TrieSet map a -> (TrieSet map a, TrieSet map a)
split = (TrieSetBase map a Bool -> TrieSet map a)
-> (TrieSetBase map a Bool, TrieSetBase map a Bool)
-> (TrieSet map a, TrieSet map a)
forall a b. (a -> b) -> (a, a) -> (b, b)
both TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS ((TrieSetBase map a Bool, TrieSetBase map a Bool)
-> (TrieSet map a, TrieSet map a))
-> ([a]
-> TrieSet map a
-> (TrieSetBase map a Bool, TrieSetBase map a Bool))
-> [a]
-> TrieSet map a
-> (TrieSet map a, TrieSet map a)
forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d
.: [a]
-> TrieSetBase map a Bool
-> (TrieSetBase map a Bool, TrieSetBase map a Bool)
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Boolable (st a), Trie trie st map k, OrdMap map k) =>
[k] -> trie map k a -> (trie map k a, trie map k a)
Base.split ([a]
-> TrieSetBase map a Bool
-> (TrieSetBase map a Bool, TrieSetBase map a Bool))
-> (TrieSet map a -> TrieSetBase map a Bool)
-> [a]
-> TrieSet map a
-> (TrieSetBase map a Bool, TrieSetBase map a Bool)
forall a b c d. (a -> b -> c) -> (d -> b) -> a -> d -> c
.:. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
splitMember :: OrdMap map a
=> [a] -> TrieSet map a -> (TrieSet map a, Bool, TrieSet map a)
splitMember :: forall (map :: * -> * -> *) a.
OrdMap map a =>
[a] -> TrieSet map a -> (TrieSet map a, Bool, TrieSet map a)
splitMember = (\(TrieSetBase map a Bool
l,Identity Bool
b,TrieSetBase map a Bool
g) -> (TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS TrieSetBase map a Bool
l,Identity Bool -> Bool
forall a. Identity a -> a
forall (w :: * -> *) a. Unwrappable w => w a -> a
unwrap Identity Bool
b,TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS TrieSetBase map a Bool
g)) ((TrieSetBase map a Bool, Identity Bool, TrieSetBase map a Bool)
-> (TrieSet map a, Bool, TrieSet map a))
-> ([a]
-> TrieSet map a
-> (TrieSetBase map a Bool, Identity Bool, TrieSetBase map a Bool))
-> [a]
-> TrieSet map a
-> (TrieSet map a, Bool, TrieSet map a)
forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d
.: [a]
-> TrieSetBase map a Bool
-> (TrieSetBase map a Bool, Identity Bool, TrieSetBase map a Bool)
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Boolable (st a), Trie trie st map k, OrdMap map k) =>
[k] -> trie map k a -> (trie map k a, st a, trie map k a)
Base.splitLookup ([a]
-> TrieSetBase map a Bool
-> (TrieSetBase map a Bool, Identity Bool, TrieSetBase map a Bool))
-> (TrieSet map a -> TrieSetBase map a Bool)
-> [a]
-> TrieSet map a
-> (TrieSetBase map a Bool, Identity Bool, TrieSetBase map a Bool)
forall a b c d. (a -> b -> c) -> (d -> b) -> a -> d -> c
.:. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
findPredecessor :: OrdMap map a => [a] -> TrieSet map a -> Maybe [a]
findPredecessor :: forall (map :: * -> * -> *) a.
OrdMap map a =>
[a] -> TrieSet map a -> Maybe [a]
findPredecessor = (([a], Bool) -> [a]) -> Maybe ([a], Bool) -> Maybe [a]
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ([a], Bool) -> [a]
forall a b. (a, b) -> a
fst (Maybe ([a], Bool) -> Maybe [a])
-> ([a] -> TrieSet map a -> Maybe ([a], Bool))
-> [a]
-> TrieSet map a
-> Maybe [a]
forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d
.: [a] -> TrieSetBase map a Bool -> Maybe ([a], Bool)
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Boolable (st a), Trie trie st map k, OrdMap map k) =>
[k] -> trie map k a -> Maybe ([k], a)
Base.findPredecessor ([a] -> TrieSetBase map a Bool -> Maybe ([a], Bool))
-> (TrieSet map a -> TrieSetBase map a Bool)
-> [a]
-> TrieSet map a
-> Maybe ([a], Bool)
forall a b c d. (a -> b -> c) -> (d -> b) -> a -> d -> c
.:. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
findSuccessor :: OrdMap map a => [a] -> TrieSet map a -> Maybe [a]
findSuccessor :: forall (map :: * -> * -> *) a.
OrdMap map a =>
[a] -> TrieSet map a -> Maybe [a]
findSuccessor = (([a], Bool) -> [a]) -> Maybe ([a], Bool) -> Maybe [a]
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ([a], Bool) -> [a]
forall a b. (a, b) -> a
fst (Maybe ([a], Bool) -> Maybe [a])
-> ([a] -> TrieSet map a -> Maybe ([a], Bool))
-> [a]
-> TrieSet map a
-> Maybe [a]
forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d
.: [a] -> TrieSetBase map a Bool -> Maybe ([a], Bool)
forall (trie :: (* -> * -> *) -> * -> * -> *) (map :: * -> * -> *)
(st :: * -> *) k a.
(Boolable (st a), Trie trie st map k, OrdMap map k) =>
[k] -> trie map k a -> Maybe ([k], a)
Base.findSuccessor ([a] -> TrieSetBase map a Bool -> Maybe ([a], Bool))
-> (TrieSet map a -> TrieSetBase map a Bool)
-> [a]
-> TrieSet map a
-> Maybe ([a], Bool)
forall a b c d. (a -> b -> c) -> (d -> b) -> a -> d -> c
.:. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
lookupPrefix :: Map map a => [a] -> TrieSet map a -> TrieSet map a
lookupPrefix :: forall (map :: * -> * -> *) a.
Map map a =>
[a] -> TrieSet map a -> TrieSet map a
lookupPrefix = TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS (TrieSetBase map a Bool -> TrieSet map a)
-> ([a] -> TrieSet map a -> TrieSetBase map a Bool)
-> [a]
-> TrieSet map a
-> TrieSet map a
forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d
.: [a] -> TrieSetBase map a Bool -> TrieSetBase map a Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Boolable (st a), Trie trie st map k) =>
[k] -> trie map k a -> trie map k a
Base.lookupPrefix ([a] -> TrieSetBase map a Bool -> TrieSetBase map a Bool)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> [a]
-> TrieSet map a
-> TrieSetBase map a Bool
forall a b c d. (a -> b -> c) -> (d -> b) -> a -> d -> c
.:. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
addPrefix :: Map map a => [a] -> TrieSet map a -> TrieSet map a
addPrefix :: forall (map :: * -> * -> *) a.
Map map a =>
[a] -> TrieSet map a -> TrieSet map a
addPrefix = TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS (TrieSetBase map a Bool -> TrieSet map a)
-> ([a] -> TrieSet map a -> TrieSetBase map a Bool)
-> [a]
-> TrieSet map a
-> TrieSet map a
forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d
.: [a] -> TrieSetBase map a Bool -> TrieSetBase map a Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Trie trie st map k) =>
[k] -> trie map k a -> trie map k a
Base.addPrefix ([a] -> TrieSetBase map a Bool -> TrieSetBase map a Bool)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> [a]
-> TrieSet map a
-> TrieSetBase map a Bool
forall a b c d. (a -> b -> c) -> (d -> b) -> a -> d -> c
.:. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
deletePrefix :: Map map a => [a] -> TrieSet map a -> TrieSet map a
deletePrefix :: forall (map :: * -> * -> *) a.
Map map a =>
[a] -> TrieSet map a -> TrieSet map a
deletePrefix = TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS (TrieSetBase map a Bool -> TrieSet map a)
-> ([a] -> TrieSet map a -> TrieSetBase map a Bool)
-> [a]
-> TrieSet map a
-> TrieSet map a
forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d
.: [a] -> TrieSetBase map a Bool -> TrieSetBase map a Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Trie trie st map k) =>
[k] -> trie map k a -> trie map k a
Base.deletePrefix ([a] -> TrieSetBase map a Bool -> TrieSetBase map a Bool)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> [a]
-> TrieSet map a
-> TrieSetBase map a Bool
forall a b c d. (a -> b -> c) -> (d -> b) -> a -> d -> c
.:. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
deleteSuffixes :: Map map a => [a] -> TrieSet map a -> TrieSet map a
deleteSuffixes :: forall (map :: * -> * -> *) a.
Map map a =>
[a] -> TrieSet map a -> TrieSet map a
deleteSuffixes = TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS (TrieSetBase map a Bool -> TrieSet map a)
-> ([a] -> TrieSet map a -> TrieSetBase map a Bool)
-> [a]
-> TrieSet map a
-> TrieSet map a
forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d
.: [a] -> TrieSetBase map a Bool -> TrieSetBase map a Bool
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Boolable (st a), Trie trie st map k) =>
[k] -> trie map k a -> trie map k a
Base.deleteSuffixes ([a] -> TrieSetBase map a Bool -> TrieSetBase map a Bool)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> [a]
-> TrieSet map a
-> TrieSetBase map a Bool
forall a b c d. (a -> b -> c) -> (d -> b) -> a -> d -> c
.:. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
splitPrefix :: Map map a => TrieSet map a -> ([a], Bool, TrieSet map a)
splitPrefix :: forall (map :: * -> * -> *) a.
Map map a =>
TrieSet map a -> ([a], Bool, TrieSet map a)
splitPrefix = (\([a]
k,Identity Bool
b,TrieSetBase map a Bool
t) -> ([a]
k,Identity Bool -> Bool
forall a. Identity a -> a
forall (w :: * -> *) a. Unwrappable w => w a -> a
unwrap Identity Bool
b,TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS TrieSetBase map a Bool
t)) (([a], Identity Bool, TrieSetBase map a Bool)
-> ([a], Bool, TrieSet map a))
-> (TrieSet map a -> ([a], Identity Bool, TrieSetBase map a Bool))
-> TrieSet map a
-> ([a], Bool, TrieSet map a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSetBase map a Bool
-> ([a], Identity Bool, TrieSetBase map a Bool)
forall (trie :: (* -> * -> *) -> * -> * -> *) (map :: * -> * -> *)
(st :: * -> *) k a.
(Alt st a, Trie trie st map k) =>
trie map k a -> ([k], st a, trie map k a)
Base.splitPrefix (TrieSetBase map a Bool
-> ([a], Identity Bool, TrieSetBase map a Bool))
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> ([a], Identity Bool, TrieSetBase map a Bool)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
children :: Map map a => TrieSet map a -> map a (TrieSet map a)
children :: forall (map :: * -> * -> *) a.
Map map a =>
TrieSet map a -> map a (TrieSet map a)
children = (TrieSetBase map a Bool -> TrieSet map a)
-> map a (TrieSetBase map a Bool) -> map a (TrieSet map a)
forall a b. (a -> b) -> map a a -> map a b
forall (m :: * -> * -> *) k a b.
Map m k =>
(a -> b) -> m k a -> m k b
Map.map TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS (map a (TrieSetBase map a Bool) -> map a (TrieSet map a))
-> (TrieSet map a -> map a (TrieSetBase map a Bool))
-> TrieSet map a
-> map a (TrieSet map a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSetBase map a Bool -> map a (TrieSetBase map a Bool)
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Boolable (st a), Trie trie st map k) =>
trie map k a -> CMap trie map k a
Base.children (TrieSetBase map a Bool -> map a (TrieSetBase map a Bool))
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> map a (TrieSetBase map a Bool)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
children1 :: Map map a => TrieSet map a -> map a (TrieSet map a)
children1 :: forall (map :: * -> * -> *) a.
Map map a =>
TrieSet map a -> map a (TrieSet map a)
children1 = (TrieSetBase map a Bool -> TrieSet map a)
-> map a (TrieSetBase map a Bool) -> map a (TrieSet map a)
forall a b. (a -> b) -> map a a -> map a b
forall (m :: * -> * -> *) k a b.
Map m k =>
(a -> b) -> m k a -> m k b
Map.map TrieSetBase map a Bool -> TrieSet map a
forall (map :: * -> * -> *) a.
TrieSetBase map a Bool -> TrieSet map a
TS (map a (TrieSetBase map a Bool) -> map a (TrieSet map a))
-> (TrieSet map a -> map a (TrieSetBase map a Bool))
-> TrieSet map a
-> map a (TrieSet map a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSetBase map a Bool -> map a (TrieSetBase map a Bool)
forall (st :: * -> *) a (trie :: (* -> * -> *) -> * -> * -> *)
(map :: * -> * -> *) k.
(Alt st a, Trie trie st map k) =>
trie map k a -> CMap trie map k a
Base.children1 (TrieSetBase map a Bool -> map a (TrieSetBase map a Bool))
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> map a (TrieSetBase map a Bool)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS
showTrie :: (Show a, Map map a) => TrieSet map a -> ShowS
showTrie :: forall a (map :: * -> * -> *).
(Show a, Map map a) =>
TrieSet map a -> ShowS
showTrie = (Identity Bool -> ShowS) -> TrieSetBase map a Bool -> ShowS
forall k (trie :: (* -> * -> *) -> * -> * -> *) (st :: * -> *)
(map :: * -> * -> *) a.
(Show k, Trie trie st map k) =>
(st a -> ShowS) -> trie map k a -> ShowS
Base.showTrieWith (\(Id Bool
b) -> Char -> ShowS
showChar (Char -> ShowS) -> Char -> ShowS
forall a b. (a -> b) -> a -> b
$ if Bool
b then Char
'X' else Char
' ')
(TrieSetBase map a Bool -> ShowS)
-> (TrieSet map a -> TrieSetBase map a Bool)
-> TrieSet map a
-> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrieSet map a -> TrieSetBase map a Bool
forall (map :: * -> * -> *) a.
TrieSet map a -> TrieSetBase map a Bool
unTS