ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

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

Documentation

data NameAlphabet Source #

Permitted leading characters of ecosystem package names.

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.

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.