ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Registry.FirstParty

Description

First-party declarations by exact name or separator-delimited prefix, compared through one ownership key. Each adapter declares how it reads and matches its entries, so a mount's FirstParty names no ecosystem. Prefix grammars share FirstPartyGrammar, and its tag keeps one ecosystem's entries apart from another's.

Synopsis

Adapter declarations

data FirstPartyNames entry Source #

How an adapter reads its configured firstParty entries and matches a name against them.

Constructors

FirstPartyNames 

Fields

data FirstPartyDeclaration Source #

An adapter's first-party grammar, whatever its entry type.

Constructors

(Eq entry, Show entry, Typeable entry) => FirstPartyDeclaration (FirstPartyNames entry) 

data FirstParty Source #

A mount's declared entries, under the grammar of the adapter that read them.

Constructors

(Eq entry, Show entry, Typeable entry) => FirstParty (FirstPartyNames entry) (NonEmpty entry) 

Instances

Instances details
Show FirstParty Source # 
Instance details

Defined in Ecluse.Core.Registry.FirstParty

Eq FirstParty Source #

Declarations compare by their entries. Entries of another type, such as another adapter's, never compare equal.

Instance details

Defined in Ecluse.Core.Registry.FirstParty

firstPartyName :: FirstParty -> PackageName -> Bool Source #

Whether the mount's declaration owns a name: the one predicate every consumer of the privilege reads.

Shared name and prefix grammar

data FirstPartyGrammar (ecosystem :: k) Source #

How one ecosystem spells and compares first-party names.

Constructors

FirstPartyGrammar 

Fields

data FirstPartyEntry (ecosystem :: k) Source #

An exact name or a prefix declared by the registry operator.

Constructors

OwnedName PackageName

Claim the names whose ownership key equals this name's.

OwnedPrefix FirstPartyPrefix

Claim the names whose ownership key begins with this prefix, separator included.

Instances

Instances details
Show (FirstPartyEntry ecosystem) Source # 
Instance details

Defined in Ecluse.Core.Registry.FirstParty

Methods

showsPrec :: Int -> FirstPartyEntry ecosystem -> ShowS #

show :: FirstPartyEntry ecosystem -> String #

showList :: [FirstPartyEntry ecosystem] -> ShowS #

Eq (FirstPartyEntry ecosystem) Source # 
Instance details

Defined in Ecluse.Core.Registry.FirstParty

Methods

(==) :: FirstPartyEntry ecosystem -> FirstPartyEntry ecosystem -> Bool #

(/=) :: FirstPartyEntry ecosystem -> FirstPartyEntry ecosystem -> Bool #

data FirstPartyPrefix Source #

An ownership-key prefix with a validated terminal separator.

parseFirstPartyEntry :: forall {k} (ecosystem :: k). FirstPartyGrammar ecosystem -> Text -> Either ParseError (FirstPartyEntry ecosystem) Source #

Parse an exact name or a prefix ending in a separator then *. Refuse acme*, which would claim acmeco.

ownsFirstPartyName :: forall {k} (ecosystem :: k). FirstPartyGrammar ecosystem -> NonEmpty (FirstPartyEntry ecosystem) -> PackageName -> Bool Source #

Whether any entry owns the name. A name without an ownership key is never owned.