ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Ecosystem

Description

The ecosystem tag, the shared vocabulary the rest of the system dispatches on. The package vocabulary keys a PackageName by it, the version engine selects a per-ecosystem parser by it, the registry adapters dispatch on it, and configuration keys a mount by it.

It sits in its own module to break the import cycle between Ecluse.Core.Package (whose PackageDetails holds a Version) and Ecluse.Core.Version (whose parsers dispatch on the ecosystem).

Synopsis

Documentation

data Ecosystem Source #

The package ecosystem an identity, version, or snapshot belongs to.

Constructors

Npm 
PyPI 
RubyGems 

Instances

Instances details
WireVocab Ecosystem Source # 
Instance details

Defined in Ecluse.Core.Ecosystem

Generic Ecosystem Source # 
Instance details

Defined in Ecluse.Core.Ecosystem

Associated Types

type Rep Ecosystem 
Instance details

Defined in Ecluse.Core.Ecosystem

type Rep Ecosystem = D1 ('MetaData "Ecosystem" "Ecluse.Core.Ecosystem" "ecluse-0.4.0-inplace-ecluse-core" 'False) (C1 ('MetaCons "Npm" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "PyPI" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RubyGems" 'PrefixI 'False) (U1 :: Type -> Type)))
Show Ecosystem Source # 
Instance details

Defined in Ecluse.Core.Ecosystem

Eq Ecosystem Source # 
Instance details

Defined in Ecluse.Core.Ecosystem

Ord Ecosystem Source # 
Instance details

Defined in Ecluse.Core.Ecosystem

Universe Ecosystem Source # 
Instance details

Defined in Ecluse.Core.Ecosystem

Methods

universe :: [Ecosystem] #

type Rep Ecosystem Source # 
Instance details

Defined in Ecluse.Core.Ecosystem

type Rep Ecosystem = D1 ('MetaData "Ecosystem" "Ecluse.Core.Ecosystem" "ecluse-0.4.0-inplace-ecluse-core" 'False) (C1 ('MetaCons "Npm" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "PyPI" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RubyGems" 'PrefixI 'False) (U1 :: Type -> Type)))

ecosystemName :: Ecosystem -> Text Source #

The canonical wire/config name of an ecosystem: the key an operator writes a mounts object under, and the inverse of parseEcosystem.

>>> ecosystemName Npm
"npm"

parseEcosystem :: Text -> Maybe Ecosystem Source #

Parse an Ecosystem from its wire name, Nothing for one the build does not serve. The config decoder reads the document's mounts keys with it, and rejects an unknown key loudly rather than skipping it (see Ecluse.Config).

>>> parseEcosystem "npm"
Just Npm
>>> parseEcosystem "cargo"
Nothing

prefixFor :: Ecosystem -> NonEmpty Text Source #

The path prefix a mount serves under, derived from its ecosystem and never operator-configured, so it can neither collide nor be mistyped. A root mount is unrepresentable.

>>> prefixFor Npm
"npm" :| []