finos/morphir-elm/21.0.0

NOTE: the latest version is 22.0.2

Formerly Morgan-Stanley/morphir-elm. Search finds this package by either name.

Morphir.Metadata

The Metadata module analyses a distribution for the type of metadata information that would be helpful in automating things like data dictionaries, lineage tracking, and the such.

Types

type alias BaseTypes =
Dict FQName FQName

The registry of base types through the entire distribution. A base type is any union type that has only one single-argument option.

An enum extension is a special pattern of union type that is either an enum or a name with no arguments

type alias Enums =
Dict FQName (List Name)

The registry of enums through the entire distribution. An enum is identified as any union type that has only non-argument options.

type alias Modules =
List ModuleName

The registry of modules through entire distribution.

type alias Types ta =
Dict FQName (Documented (Definition ta))

The registry of types through entire distribution.

type alias Aliases =
Dict FQName FQName

The registry of aliases through the entire distribution. An alias is any type alias that aliases a non-record type.

type Metadata ta

Structure for holding metadata information from processing the distribution.

type alias UnionTypes ta =
Dict FQName (Documented (Definition ta))

The registry of union types through the entire distribution. A union type is any ADT that has more than one single-argument option.

Processing

Process this distribution into a Metadata structure.

Utilities

getTypes : Metadata ta -> Types ta

Access function for getting the type registry from a Metadata structure.

getEnums : Metadata ta -> Enums

Access function for getting the enum registry from a Metadata structure.

getBaseTypes : Metadata ta -> BaseTypes

Access function for getting the base type registry from a Metadata structure.

getAliases : Metadata ta -> Aliases

Access function for getting the alias type registry from a Metadata structure.

getDocumentation : Metadata ta -> FQName -> Maybe String

Access function for getting the full type registry from a Metadata structure.

getModules : Metadata ta -> Modules

Access function for getting the module registry from a Metadata structure.

Access function for getting the enum registry from a Metadata structure that includes EnumExtensions.

Extract the names out of an enum extension.

getUnions : Metadata ta -> UnionTypes ta

Access function for getting the union type registry from a Metadata structure.

isEnumExtension : Metadata a -> Constructors a -> Bool

Decides whether a union type is an enum by ensuring it only has constructors with base type enum or no arg constructors.