| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
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
- data FirstPartyNames entry = FirstPartyNames {
- namesEntry :: Text -> Either ParseError entry
- namesOwn :: NonEmpty entry -> PackageName -> Bool
- namesEntryNoun :: Text
- namesListNoun :: Text
- data FirstPartyDeclaration = (Eq entry, Show entry, Typeable entry) => FirstPartyDeclaration (FirstPartyNames entry)
- data FirstParty = (Eq entry, Show entry, Typeable entry) => FirstParty (FirstPartyNames entry) (NonEmpty entry)
- firstPartyName :: FirstParty -> PackageName -> Bool
- data FirstPartyGrammar (ecosystem :: k) = FirstPartyGrammar {
- fpLabel :: Text
- fpSeparator :: Char -> Bool
- fpProjectName :: Text -> Either ParseError PackageName
- fpOwnershipKey :: PackageName -> Maybe Text
- data FirstPartyEntry (ecosystem :: k)
- data FirstPartyPrefix
- parseFirstPartyEntry :: forall {k} (ecosystem :: k). FirstPartyGrammar ecosystem -> Text -> Either ParseError (FirstPartyEntry ecosystem)
- ownsFirstPartyName :: forall {k} (ecosystem :: k). FirstPartyGrammar ecosystem -> NonEmpty (FirstPartyEntry ecosystem) -> PackageName -> Bool
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
| Show FirstParty Source # | |
Defined in Ecluse.Core.Registry.FirstParty Methods showsPrec :: Int -> FirstParty -> ShowS # show :: FirstParty -> String # showList :: [FirstParty] -> ShowS # | |
| Eq FirstParty Source # | Declarations compare by their entries. Entries of another type, such as another adapter's, never compare equal. |
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
| Show (FirstPartyEntry ecosystem) Source # | |
Defined in Ecluse.Core.Registry.FirstParty Methods showsPrec :: Int -> FirstPartyEntry ecosystem -> ShowS # show :: FirstPartyEntry ecosystem -> String # showList :: [FirstPartyEntry ecosystem] -> ShowS # | |
| Eq (FirstPartyEntry ecosystem) Source # | |
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.
Instances
| Show FirstPartyPrefix Source # | |
Defined in Ecluse.Core.Registry.FirstParty Methods showsPrec :: Int -> FirstPartyPrefix -> ShowS # show :: FirstPartyPrefix -> String # showList :: [FirstPartyPrefix] -> ShowS # | |
| Eq FirstPartyPrefix Source # | |
Defined in Ecluse.Core.Registry.FirstParty Methods (==) :: FirstPartyPrefix -> FirstPartyPrefix -> Bool # (/=) :: FirstPartyPrefix -> FirstPartyPrefix -> Bool # | |
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.