Morgan-Stanley/morphir-elm/3.0.0

Renamed to finos/morphir-elm. It is published under that name, and new versions come out there.

Versions published as Morgan-Stanley/morphir-elm still install under that name. 5 versions of 5 come from the new location (see their notes).

Rerouted (renamed, needs approval). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/finos/morphir-elm.

What we checked: The repo moved to github.com/finos/morphir-elm and tag 3.0.0 is there; its commit 5fb93bcdc077 is from 2020-10-29 14:07 UTC, after the version was published (2020-08-17 21:31 UTC); elm.json differs from package.elm-lang.org's; the exposed modules match docs.json; the zip's SHA-1 is not the published one and nothing else confirms its contents.

We could not verify this copy against what was published, so the Lamdera compiler asks before using it (y/n). Without a terminal, as in CI, it stops with an error unless approved:

  • lamdera make --auto-approve-package-rerouting approves rerouted versions for that run,
  • LAMDERA_AUTO_APPROVE_PACKAGE_REROUTING=1 does the same for every run in that environment,
  • LAMDERA_CACHE=off skips the Lamdera package server altogether: packages come from package.elm-lang.org and GitHub only, as with elm, and a rerouted version then fails to download.

Details · package.elm-lang.org's zip: https://github.com/Morgan-Stanley/morphir-elm/zipball/3.0.0/

Morphir.IR.Path

Path is a list of names that represents a path in the tree. It's used at various places in the IR to identify types and values.

type alias Path =
List Name

Type that represents a path as a list of names.

fromList : List Name -> Path

Converts a list of names to a path.

toList : Path -> List Name

Converts a path to a list of names.

String conversion

fromString : String -> Path

Translates a string into a path by splitting it into names along special characters. The algorithm will treat any non-word charaters that are not spaces as a path separator.

fromString "fooBar.Baz"
--> Path.fromList
-->     [ Name.fromList [ "foo", "bar" ]
-->     , Name.fromList [ "baz" ]
-->     ]


fromString "foo bar/baz"
--> Path.fromList
-->     [ Name.fromList [ "foo", "bar" ]
-->     , Name.fromList [ "baz" ]
-->     ]
toString : (Name -> String) -> String -> Path -> String

Turn a path into a string using the specified naming convention and separator.

path =
    Path.fromList
        [ Name.fromList [ "foo", "bar" ]
        , Name.fromList [ "baz" ]
        ]


toString Name.toTitleCase "." path
--> "FooBar.Baz"


toString Name.toSnakeCase "/" path
--> "foo_bar/baz"

Utilities

isPrefixOf : Path -> Path -> Bool

Checks if a path is a prefix of another.

isPrefixOf [ [ "foo" ], [ "bar" ] ] [ [ "foo" ] ] == True


isPrefixOf [ [ "foo" ] ] [ [ "foo" ], [ "bar" ] ] == False


isPrefixOf [ [ "foo" ], [ "bar" ] ] [ [ "foo" ], [ "bar" ] ] == True