finos/morphir-elm/8.0.0

NOTE: the latest version is 22.0.2

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

Morphir.IR.Distribution

A distribution is a complete package of Morphir types and functions with all their dependencies. morphir-elm make produces a JSON that represents a Distribution. We are planning to define different types of distributions in the future but currently the only one is Library. A library contains the following pieces of information:

  • The name of the library. This is the globally unique identifier of the package like the package name in NPM or the Group and Artifact ID in Maven.
  • All the library dependencies as a dictionary of package name and package specification. The package specification only contains type signatures, no implementations.
  • The package definition which contains all the module definitions included in the library. The package definition contains implementations as well, even ones that are not exposed.
= Library
PackageName
(Dict PackageName (Specification ()))
(Definition () (Type ()))

Type that represents a package distribution. Currently the only distribution type we provide is a Library.

Lookups

lookupModuleSpecification : PackageName -> ModuleName -> Distribution -> Maybe (Specification ())

Look up a module specification by package and module path in a distribution.

PackageName
-> ModuleName
-> Name
-> Maybe (Specification ())

Look up a type specification by package, module and local name in a distribution.

PackageName
-> ModuleName
-> Name
-> Maybe (Specification ())

Look up a value specification by package, module and local name in a distribution.

Look up the base type name following aliases by package, module and local name in a distribution.

lookupValueDefinition : QName -> Distribution -> Maybe (Definition () (Type ()))

Look up a value definition by qualified name in a distribution. The value will only be searched in the current package.

Utilities

resolveTypeReference : FQName -> List (Type ()) -> Distribution -> Result String (Type ())

Resolve a type reference by looking up its specification and resolving type variables.

Replace record constructors with the corresponding record value.