Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
(Import this module qualified)
Synopsis
- data Changed
- maybeChanged :: Maybe a -> Changed
- data Equiv k = Equiv {
- equivFwd :: !(IntLikeMap k (IntLikeSet k))
- equivBwd :: !(IntLikeMap k k)
- emptyEquiv :: Equiv k
- data Entry k v
- = EntryLink !k
- | EntryValue !v
- filterRootEntries :: Coercible k Int => IntLikeMap k (Entry k v) -> IntLikeMap k v
- type MergeOne e v r = Maybe v -> v -> Either e (r, v)
- type MergeMany f e v r = Maybe v -> f v -> Either e (r, v)
- adaptMergeOne :: (v -> f v) -> MergeMany f e v r -> MergeOne e v r
- foldMergeOne :: Monoid r => (v -> v -> Either e (r, v)) -> MergeOne e v r
- foldMergeMany :: (Foldable f, Monoid r) => Either e v -> (v -> v -> Either e (r, v)) -> MergeMany f e v r
- concatMergeOne :: Semigroup v => MergeOne e v ()
- concatMergeMany :: (Foldable f, Monoid v) => MergeMany f e v ()
- data UnionMap k v
- type UnionMapLens s k v = Lens' s (UnionMap k v)
- empty :: UnionMap k v
- size :: UnionMap k v -> Int
- member :: Coercible k Int => k -> UnionMap k v -> Bool
- toList :: Coercible k Int => UnionMap k v -> [(k, Entry k v)]
- values :: Coercible k Int => UnionMap k v -> IntLikeMap k v
- data AddRes k v
- = AddResAdded !(UnionMap k v)
- | AddResDuplicate
- data AddVal
- add :: Coercible k Int => k -> v -> UnionMap k v -> AddRes k v
- addLM :: (Coercible k Int, MonadState s m) => UnionMapLens s k v -> k -> v -> m AddVal
- addM :: (Coercible k Int, MonadState (UnionMap k v) m) => k -> v -> m AddVal
- data TraceRes k v
- = TraceResMissing !k
- | TraceResFound !k !v ![k]
- trace :: Coercible k Int => k -> UnionMap k v -> TraceRes k v
- data LookupRes k v
- = LookupResMissing !k
- | LookupResFound !k !v !(Maybe (UnionMap k v))
- data LookupVal k v
- = LookupValMissing !k
- | LookupValOk !k !v !Changed
- lookup :: Coercible k Int => k -> UnionMap k v -> LookupRes k v
- lookupLM :: (Coercible k Int, MonadState s m) => UnionMapLens s k v -> k -> m (LookupVal k v)
- lookupM :: (Coercible k Int, MonadState (UnionMap k v) m) => k -> m (LookupVal k v)
- equiv :: Coercible k Int => UnionMap k v -> (Equiv k, Maybe (UnionMap k v))
- equivLM :: (Coercible k Int, MonadState s m) => UnionMapLens s k v -> m (Equiv k)
- equivM :: (Coercible k Int, MonadState (UnionMap k v) m) => m (Equiv k)
- compact :: Coercible k Int => UnionMap k v -> (IntLikeMap k k, UnionMap k v)
- compactLM :: (Coercible k Int, MonadState s m) => UnionMapLens s k v -> m (IntLikeMap k k)
- compactM :: (Coercible k Int, MonadState (UnionMap k v) m) => m (IntLikeMap k k)
- canonicalize :: Coercible k Int => Traversal' v k -> UnionMap k v -> (IntLikeMap k k, UnionMap k v)
- canonicalizeLM :: (Coercible k Int, MonadState s m) => UnionMapLens s k v -> Traversal' v k -> m (IntLikeMap k k)
- canonicalizeM :: (Coercible k Int, MonadState (UnionMap k v) m) => Traversal' v k -> m (IntLikeMap k k)
- data UpdateRes e k v r
- = UpdateResMissing !k
- | UpdateResEmbed !e
- | UpdateResAdded !v !r !(UnionMap k v)
- | UpdateResUpdated !k !v !r !(UnionMap k v)
- data UpdateVal e k v r
- = UpdateValMissing !k
- | UpdateValEmbed !e
- | UpdateValAdded !v !r
- | UpdateValUpdated !k !v !r
- update :: (Coercible k Int, Eq k) => MergeOne e v r -> k -> v -> UnionMap k v -> UpdateRes e k v r
- updateLM :: (Coercible k Int, Eq k, MonadState s m) => UnionMapLens s k v -> MergeOne e v r -> k -> v -> m (UpdateVal e k v r)
- updateM :: (Coercible k Int, Eq k, MonadState (UnionMap k v) m) => MergeOne e v r -> k -> v -> m (UpdateVal e k v r)
- data MergeRes e k v r
- = MergeResMissing !k
- | MergeResEmbed !e
- | MergeResMerged !k !v !r !(UnionMap k v)
- data MergeVal e k v r
- = MergeValMissing !k
- | MergeValEmbed !e
- | MergeValMerged !k !v !r
- mergeOne :: (Coercible k Int, Eq k) => MergeOne e v r -> k -> k -> UnionMap k v -> MergeRes e k v r
- mergeOneLM :: (Coercible k Int, Eq k, MonadState s m) => UnionMapLens s k v -> MergeOne e v r -> k -> k -> m (MergeVal e k v r)
- mergeOneM :: (Coercible k Int, Eq k, MonadState (UnionMap k v) m) => MergeOne e v r -> k -> k -> m (MergeVal e k v r)
- mergeMany :: (Traversable f, Coercible k Int, Eq k) => MergeMany f e v r -> k -> f k -> UnionMap k v -> MergeRes e k v r
- mergeManyLM :: (Traversable f, Coercible k Int, Eq k, MonadState s m) => UnionMapLens s k v -> MergeMany f e v r -> k -> f k -> m (MergeVal e k v r)
- mergeManyM :: (Traversable f, Coercible k Int, Eq k, MonadState (UnionMap k v) m) => MergeMany f e v r -> k -> f k -> m (MergeVal e k v r)
- extract :: Coercible k Int => Traversal' v k -> k -> UnionMap k v -> (Maybe (k, IntLikeMap k v), UnionMap k v)
- extractLM :: (Coercible k Int, MonadState s m) => UnionMapLens s k v -> Traversal' v k -> k -> m (Maybe (k, IntLikeMap k v))
- extractM :: (Coercible k Int, MonadState (UnionMap k v) m) => Traversal' v k -> k -> m (Maybe (k, IntLikeMap k v))
Documentation
maybeChanged :: Maybe a -> Changed Source #
Equiv | |
|
emptyEquiv :: Equiv k Source #
EntryLink !k | |
EntryValue !v |
Instances
Foldable (Entry k) Source # | |
Defined in Unimap fold :: Monoid m => Entry k m -> m # foldMap :: Monoid m => (a -> m) -> Entry k a -> m # foldMap' :: Monoid m => (a -> m) -> Entry k a -> m # foldr :: (a -> b -> b) -> b -> Entry k a -> b # foldr' :: (a -> b -> b) -> b -> Entry k a -> b # foldl :: (b -> a -> b) -> b -> Entry k a -> b # foldl' :: (b -> a -> b) -> b -> Entry k a -> b # foldr1 :: (a -> a -> a) -> Entry k a -> a # foldl1 :: (a -> a -> a) -> Entry k a -> a # elem :: Eq a => a -> Entry k a -> Bool # maximum :: Ord a => Entry k a -> a # minimum :: Ord a => Entry k a -> a # | |
Traversable (Entry k) Source # | |
Functor (Entry k) Source # | |
(Show k, Show v) => Show (Entry k v) Source # | |
(Eq k, Eq v) => Eq (Entry k v) Source # | |
(Ord k, Ord v) => Ord (Entry k v) Source # | |
Defined in Unimap |
filterRootEntries :: Coercible k Int => IntLikeMap k (Entry k v) -> IntLikeMap k v Source #
adaptMergeOne :: (v -> f v) -> MergeMany f e v r -> MergeOne e v r Source #
foldMergeMany :: (Foldable f, Monoid r) => Either e v -> (v -> v -> Either e (r, v)) -> MergeMany f e v r Source #
concatMergeOne :: Semigroup v => MergeOne e v () Source #
Instances
Foldable (UnionMap k) Source # | |
Defined in Unimap fold :: Monoid m => UnionMap k m -> m # foldMap :: Monoid m => (a -> m) -> UnionMap k a -> m # foldMap' :: Monoid m => (a -> m) -> UnionMap k a -> m # foldr :: (a -> b -> b) -> b -> UnionMap k a -> b # foldr' :: (a -> b -> b) -> b -> UnionMap k a -> b # foldl :: (b -> a -> b) -> b -> UnionMap k a -> b # foldl' :: (b -> a -> b) -> b -> UnionMap k a -> b # foldr1 :: (a -> a -> a) -> UnionMap k a -> a # foldl1 :: (a -> a -> a) -> UnionMap k a -> a # toList :: UnionMap k a -> [a] # null :: UnionMap k a -> Bool # length :: UnionMap k a -> Int # elem :: Eq a => a -> UnionMap k a -> Bool # maximum :: Ord a => UnionMap k a -> a # minimum :: Ord a => UnionMap k a -> a # | |
Traversable (UnionMap k) Source # | |
Functor (UnionMap k) Source # | |
(Show k, Show v) => Show (UnionMap k v) Source # | |
(Eq k, Eq v) => Eq (UnionMap k v) Source # | |
type UnionMapLens s k v = Lens' s (UnionMap k v) Source #
AddResAdded !(UnionMap k v) | |
AddResDuplicate |
addLM :: (Coercible k Int, MonadState s m) => UnionMapLens s k v -> k -> v -> m AddVal Source #
TraceResMissing !k | |
TraceResFound !k !v ![k] |
LookupResMissing !k | |
LookupResFound !k !v !(Maybe (UnionMap k v)) |
LookupValMissing !k | |
LookupValOk !k !v !Changed |
lookupLM :: (Coercible k Int, MonadState s m) => UnionMapLens s k v -> k -> m (LookupVal k v) Source #
equivLM :: (Coercible k Int, MonadState s m) => UnionMapLens s k v -> m (Equiv k) Source #
compact :: Coercible k Int => UnionMap k v -> (IntLikeMap k k, UnionMap k v) Source #
Compresses all paths so there is never more than one jump to the root of each class Retains all keys in the map but returns a mapping of non-root -> root keys
compactLM :: (Coercible k Int, MonadState s m) => UnionMapLens s k v -> m (IntLikeMap k k) Source #
compactM :: (Coercible k Int, MonadState (UnionMap k v) m) => m (IntLikeMap k k) Source #
canonicalize :: Coercible k Int => Traversal' v k -> UnionMap k v -> (IntLikeMap k k, UnionMap k v) Source #
Compacts and rewrites all values with canonical keys. Retains all keys in the map and again returns a mapping of non-root -> root keys. TODO remove non-canonical keys?
canonicalizeLM :: (Coercible k Int, MonadState s m) => UnionMapLens s k v -> Traversal' v k -> m (IntLikeMap k k) Source #
canonicalizeM :: (Coercible k Int, MonadState (UnionMap k v) m) => Traversal' v k -> m (IntLikeMap k k) Source #
data UpdateRes e k v r Source #
UpdateResMissing !k | |
UpdateResEmbed !e | |
UpdateResAdded !v !r !(UnionMap k v) | |
UpdateResUpdated !k !v !r !(UnionMap k v) |
data UpdateVal e k v r Source #
UpdateValMissing !k | |
UpdateValEmbed !e | |
UpdateValAdded !v !r | |
UpdateValUpdated !k !v !r |
update :: (Coercible k Int, Eq k) => MergeOne e v r -> k -> v -> UnionMap k v -> UpdateRes e k v r Source #
updateLM :: (Coercible k Int, Eq k, MonadState s m) => UnionMapLens s k v -> MergeOne e v r -> k -> v -> m (UpdateVal e k v r) Source #
updateM :: (Coercible k Int, Eq k, MonadState (UnionMap k v) m) => MergeOne e v r -> k -> v -> m (UpdateVal e k v r) Source #
data MergeRes e k v r Source #
MergeResMissing !k | |
MergeResEmbed !e | |
MergeResMerged !k !v !r !(UnionMap k v) |
data MergeVal e k v r Source #
MergeValMissing !k | |
MergeValEmbed !e | |
MergeValMerged !k !v !r |
mergeOne :: (Coercible k Int, Eq k) => MergeOne e v r -> k -> k -> UnionMap k v -> MergeRes e k v r Source #
mergeOneLM :: (Coercible k Int, Eq k, MonadState s m) => UnionMapLens s k v -> MergeOne e v r -> k -> k -> m (MergeVal e k v r) Source #
mergeOneM :: (Coercible k Int, Eq k, MonadState (UnionMap k v) m) => MergeOne e v r -> k -> k -> m (MergeVal e k v r) Source #
mergeMany :: (Traversable f, Coercible k Int, Eq k) => MergeMany f e v r -> k -> f k -> UnionMap k v -> MergeRes e k v r Source #
mergeManyLM :: (Traversable f, Coercible k Int, Eq k, MonadState s m) => UnionMapLens s k v -> MergeMany f e v r -> k -> f k -> m (MergeVal e k v r) Source #
mergeManyM :: (Traversable f, Coercible k Int, Eq k, MonadState (UnionMap k v) m) => MergeMany f e v r -> k -> f k -> m (MergeVal e k v r) Source #
extract :: Coercible k Int => Traversal' v k -> k -> UnionMap k v -> (Maybe (k, IntLikeMap k v), UnionMap k v) Source #
Return the subgraph accessible from a given key.
extractLM :: (Coercible k Int, MonadState s m) => UnionMapLens s k v -> Traversal' v k -> k -> m (Maybe (k, IntLikeMap k v)) Source #
extractM :: (Coercible k Int, MonadState (UnionMap k v) m) => Traversal' v k -> k -> m (Maybe (k, IntLikeMap k v)) Source #