finos/morphir-elm

Remove Field from value expressions in the IR and use FieldFunction with Apply as a replacement

Offen

#156 geöffnet am 17.09.2020

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Elm (69 Forks)auto 404
enhancementgood first issueir-simplification

Repository-Metriken

Stars
 (51 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 3h 4m) (2 gemergte PRs in 30 T)

Beschreibung

Currently the IR has both Field and FieldFunction as values in the IR. The corresponding example in Elm would be a.foo vs. .foo. The idea is that a.foo can be represented as .foo a (applying the .foo function to a). The latter is more generic and the former is basically just a special combination of FieldFunction and Apply therefore it's accidental complexity which should be removed.

The specific change is to remove Field: https://github.com/finos/morphir-elm/blob/5e18e70bd4631aea1d1b677be04b62de3069a5eb/src/Morphir/IR/Value.elm#L90

And replace throughout the codebase using the following substitution rule:

Field a subjectValue fieldName -> Apply a (FieldFunction a fieldName) subjectValue

Contributor Guide