| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Registry.Maintenance.NameSpace
Description
The buckets a store's name space is walked in.
A bucket is a leading-character prefix of a package's base name, so the buckets of one alphabet are disjoint and cover every permitted name. A backend that cannot filter its listing takes the empty alphabet, whose single bucket is the whole store.
Synopsis
- data NameAlphabet
- mkNameAlphabet :: [Char] -> NameAlphabet
- noNameAlphabet :: NameAlphabet
- data NamePrefix
- wholeNameSpace :: NamePrefix
- renderNamePrefix :: NamePrefix -> Text
- parseNamePrefix :: NameAlphabet -> Text -> Maybe NamePrefix
- initialBuckets :: NameAlphabet -> NonEmpty NamePrefix
- extendBucket :: NameAlphabet -> NamePrefix -> [NamePrefix]
- inBucket :: NamePrefix -> PackageName -> Bool
Documentation
data NameAlphabet Source #
Permitted leading characters of ecosystem package names.
Instances
| Show NameAlphabet Source # | |
Defined in Ecluse.Core.Registry.Maintenance.NameSpace Methods showsPrec :: Int -> NameAlphabet -> ShowS # show :: NameAlphabet -> String # showList :: [NameAlphabet] -> ShowS # | |
| Eq NameAlphabet Source # | |
Defined in Ecluse.Core.Registry.Maintenance.NameSpace | |
mkNameAlphabet :: [Char] -> NameAlphabet Source #
Build an alphabet, dropping repeats and keeping the order given.
noNameAlphabet :: NameAlphabet Source #
Use a single whole-store bucket when the backend cannot filter its listing.
data NamePrefix Source #
A bucket prefix addresses the package's base name, excluding its namespace.
Instances
| Show NamePrefix Source # | |
Defined in Ecluse.Core.Registry.Maintenance.NameSpace Methods showsPrec :: Int -> NamePrefix -> ShowS # show :: NamePrefix -> String # showList :: [NamePrefix] -> ShowS # | |
| Eq NamePrefix Source # | |
Defined in Ecluse.Core.Registry.Maintenance.NameSpace | |
| Ord NamePrefix Source # | |
Defined in Ecluse.Core.Registry.Maintenance.NameSpace Methods compare :: NamePrefix -> NamePrefix -> Ordering # (<) :: NamePrefix -> NamePrefix -> Bool # (<=) :: NamePrefix -> NamePrefix -> Bool # (>) :: NamePrefix -> NamePrefix -> Bool # (>=) :: NamePrefix -> NamePrefix -> Bool # max :: NamePrefix -> NamePrefix -> NamePrefix # min :: NamePrefix -> NamePrefix -> NamePrefix # | |
wholeNameSpace :: NamePrefix Source #
The unfiltered whole-store bucket.
renderNamePrefix :: NamePrefix -> Text Source #
The prefix as a store filter and a walk cursor spell it. Empty stands for no filter at all.
parseNamePrefix :: NameAlphabet -> Text -> Maybe NamePrefix Source #
Reject prefixes outside the current alphabet so an incompatible cursor restarts the walk.
initialBuckets :: NameAlphabet -> NonEmpty NamePrefix Source #
Partition the store into disjoint buckets that cover every permitted name.
extendBucket :: NameAlphabet -> NamePrefix -> [NamePrefix] Source #
Subdivide an oversized bucket. An empty alphabet permits no subdivision.
inBucket :: NamePrefix -> PackageName -> Bool Source #
Whether a name falls in a bucket, for a store whose listing has no prefix filter of its own.