finos/morphir-elm/17.0.0

NOTE: the latest version is 22.0.2

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

Morphir.Elm.Frontend

The Elm frontend turns Elm source code into Morphir IR.

Entry points

Options
-> PackageInfo
-> Dict Path (Specification ())
-> List SourceFile
-> Result Errors (Definition SourceLocation SourceLocation)

Function that takes some package info and a list of sources and returns Morphir IR or errors.

SourceFile
-> Exposing
-> List Declaration
-> Result
Errors
(List
( Name
, AccessControlled (Documented (Definition SourceLocation))
)
)

Function that turns elm-syntax declarations to Morphir IR types.

Utilities

defaultDependencies : Dict Path (Specification ())

Dependencies that are added by default without explicit reference.

type alias Options =
{ typesOnly : Bool }

Options that modify the behavior of the frontend:

- `typesOnly` - only include type information in the IR, no values
type alias ContentLocation =
{ row : Int
, column : Int
}
type alias ContentRange =
{ start : ContentLocation
, end : ContentLocation
}
type Error
= ParseError String (List DeadEnd)
| CyclicModules (Graph () (List String))
| ResolveError SourceLocation Error
| EmptyApply SourceLocation
| NotSupported SourceLocation String
| DuplicateNameInPattern Name SourceLocation SourceLocation
| VariableShadowing Name SourceLocation SourceLocation
| MissingTypeSignature SourceLocation
| RecordPatternNotSupported SourceLocation
| TypeInferenceError SourceLocation TypeError
type alias Errors =
List Error
type alias PackageInfo =
{ name : Path
, exposedModules : Maybe (Set Path)
}
type alias SourceFile =
{ path : String
, content : String
}
type alias SourceLocation =
{ source : SourceFile
, range : ContentRange
}
Options
-> PackageInfo
-> Dict Path (Specification ())
-> List SourceFile
-> Result (List Error) (Definition SourceLocation SourceLocation)
mapValueToFile : IR -> Type () -> String -> Result String IR
parseRawValue : IR -> String -> Result String RawValue

Parses an expression written in the Elm syntax into a RawValue.