Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More docs #74

Merged
merged 55 commits into from
May 7, 2020
Merged
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
0de01be
Added missing module declarations. #37
AttilaMihaly Mar 26, 2020
edcdabf
Process only those modules that are reachable from exposed ones. Remo…
AttilaMihaly Mar 27, 2020
97ece5c
Merge branch 'master' of https://github.com/Morgan-Stanley/morphir-elm
AttilaMihaly Mar 27, 2020
3a7d7e7
Merge branch 'master' of https://github.com/Morgan-Stanley/morphir-elm
AttilaMihaly Mar 27, 2020
b9166d9
Renaming concepts based on review feedback. #41
AttilaMihaly Mar 28, 2020
2b1e865
Merge branch 'master' of https://github.com/Morgan-Stanley/morphir-elm
AttilaMihaly Mar 28, 2020
7418534
Moved Advanced module up a level. #43
AttilaMihaly Mar 28, 2020
0fbc836
Removed unused unindent function.
AttilaMihaly Mar 30, 2020
adf0929
Moved name to SDK.
AttilaMihaly Mar 30, 2020
f3f91a1
Merge branch 'master' of https://github.com/Morgan-Stanley/morphir-elm
AttilaMihaly Mar 30, 2020
8ea37ba
Added missing module to SDK.
AttilaMihaly Mar 31, 2020
42a61ac
Merge branch 'master' of https://github.com/Morgan-Stanley/morphir-elm
AttilaMihaly Mar 31, 2020
dac3832
Partial implementation of value mapping.
AttilaMihaly Mar 31, 2020
e984520
Ignore all generated JS.
AttilaMihaly Mar 31, 2020
8c336bf
Change extra arg position and naming. #46, #25
AttilaMihaly Mar 31, 2020
d7842ef
Merge branch 'master' of https://github.com/Morgan-Stanley/morphir-elm
AttilaMihaly Mar 31, 2020
446d793
Change extra arg position and naming. #46, #25
AttilaMihaly Apr 1, 2020
812b5e0
Removed remaining references to extra. #5
AttilaMihaly Apr 1, 2020
c841efd
Change extra arg position. #46, #25, #5
AttilaMihaly Apr 1, 2020
9ce6d29
Added more coverage. #46, #25, #5
AttilaMihaly Apr 1, 2020
910d4fa
Changes suggested in the PR. #46, #25, #5
AttilaMihaly Apr 2, 2020
7ea3c13
Merge branch 'master' of https://github.com/Morgan-Stanley/morphir-elm
AttilaMihaly Apr 2, 2020
c628284
Use more explicit names.
AttilaMihaly Apr 3, 2020
b2ee848
All patterns supported.
AttilaMihaly Apr 4, 2020
2710591
Pattern-match supported.
AttilaMihaly Apr 4, 2020
4a13c93
Added support for SDK operators. #52
AttilaMihaly Apr 6, 2020
f308db7
Fix compile errors.
AttilaMihaly Apr 7, 2020
0ebe518
Prepare Elm module publishing. #2
AttilaMihaly Apr 15, 2020
08f7f2e
Fix repo name. #2
AttilaMihaly Apr 15, 2020
97d3280
Support for let expressions. #54
AttilaMihaly Apr 16, 2020
1fe672c
Merge branch 'master' into master
AttilaMihaly Apr 16, 2020
7010d20
Simple join implementations. #64
AttilaMihaly Apr 17, 2020
5cb79b3
Refactoring to make the code more organized.
AttilaMihaly Apr 17, 2020
1ba07e6
Refactoring to make the code more organized.
AttilaMihaly Apr 17, 2020
b4128ca
Prepare value mapping utils. #53
AttilaMihaly Apr 17, 2020
2d23317
More descriptive naming.
AttilaMihaly Apr 17, 2020
f583e4c
More descriptive naming.
AttilaMihaly Apr 17, 2020
6f67614
Removed unused function
AttilaMihaly Apr 17, 2020
5873328
Better naming
AttilaMihaly Apr 17, 2020
7f312ba
Added utility function and removed unused one.
AttilaMihaly Apr 17, 2020
1fdc4a4
Added variable resolution.
AttilaMihaly Apr 19, 2020
c02d138
Hooked up variable resolution and updated tests. #53
AttilaMihaly Apr 19, 2020
4dc9173
Completed reference resolution. #53
AttilaMihaly Apr 20, 2020
2cac78d
Merge branch 'master' of https://github.com/Morgan-Stanley/morphir-elm
AttilaMihaly Apr 20, 2020
8bba66f
Merge branch 'master' of https://github.com/Morgan-Stanley/morphir-elm
AttilaMihaly Apr 20, 2020
d3df1c6
Added missing docs and refactored. #68
AttilaMihaly Apr 20, 2020
55d61dc
Document and refactor driven by the goal to process Morphir using Mor…
AttilaMihaly Apr 24, 2020
3bf59a9
Various fixes. #68
AttilaMihaly Apr 28, 2020
449ea36
Merge branch 'master' of https://github.com/Morgan-Stanley/morphir-elm
AttilaMihaly Apr 28, 2020
9c5d448
Report parse errors.
AttilaMihaly Apr 28, 2020
07de3d2
Updated docs.
AttilaMihaly May 7, 2020
4777e00
Merge branch 'master' of https://github.com/Morgan-Stanley/morphir-elm
AttilaMihaly May 7, 2020
9ad3a73
Link to Elm package.
AttilaMihaly May 7, 2020
b500b73
More documentation.
AttilaMihaly May 7, 2020
5db77b9
Merge branch 'master' of https://github.com/Morgan-Stanley/morphir-elm
AttilaMihaly May 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 73 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@

morphir-elm is a set of tools to work with Morphir in Elm. It's dual published as an NPM and an Elm package:

- NPM package: [![npm version](https://badge.fury.io/js/morphir-elm.svg)](https://badge.fury.io/js/morphir-elm)
- Elm package: [![Latest version of the Elm package](https://reiner-dolp.github.io/elm-badges/Morgan-Stanley/morphir-elm/version.svg)](https://package.elm-lang.org/packages/Morgan-Stanley/morphir-elm/latest)

The NPM package provides a CLI to run the tooling while the Elm package can be used for direct integration.
The CLI currently supports the following features:
- [NPM package](#npm-package)
- [Elm package](#elm-package)

# NPM package

- [Translate Elm sources to Morphir IR](#translate-elm-sources-to-morphir-ir)
[![npm version](https://badge.fury.io/js/morphir-elm.svg)](https://badge.fury.io/js/morphir-elm)

The **morphir-elm** NPM package provides a CLI to run the tooling.

# Installation
## Installation

```
npm install -g morphir-elm
```

# Usage
## Usage

All the features can be accessed through sub-commands within the `morphir-elm` command:

Expand All @@ -27,7 +28,7 @@ morphir-elm [command]

Each command has different options which are detailed below:

## Translate Elm sources to Morphir IR
### Translate Elm sources to Morphir IR

This command reads Elm sources, translates to Morphir IR and outputs the IR into JSON.

Expand All @@ -49,11 +50,73 @@ root directory with the following structure:
}
```

### Options
#### Options

- `--project-dir <path>`, `-p`
- Root directory of the project where morphir.json is located.
- Defaults to current directory.
- `--output <path>`, `-o`
- Target location where the Morphir IR will be sent
- Defaults to STDOUT.

# Elm package

[![Latest version of the Elm package](https://reiner-dolp.github.io/elm-badges/Morgan-Stanley/morphir-elm/version.svg)](https://package.elm-lang.org/packages/Morgan-Stanley/morphir-elm/latest)

The [Morgan-Stanley/morphir-elm](https://package.elm-lang.org/packages/Morgan-Stanley/morphir-elm/latest) package
provides various tools to work with Morphir. It contains the following main components:

- The [Morphir SDK](#morphir-sdk) which provides the base set of types and functions that Morphir tools support
out-of-the-box. (the SDK is a superset [elm/core](https://package.elm-lang.org/packages/elm/core/latest) with a few
exceptions documented below)
- A type-safe API for the [Morphir IR](#morphir-ir) that allows you to create or inspect it.

## Installation

```
elm install Morgan-Stanley/morphir-elm
```

## Morphir SDK

The goal of the `Morphir.SDK` module is to provide you the basic building blocks to build your domain model and
business logic. It also serves as a specification for backend developers that describes the minimum set of functionality
each backend implementation should support.

It is generally based on [elm/core/1.0.5](https://package.elm-lang.org/packages/elm/core/1.0.5/) and provides most of
the functionality provided there except for some modules that fall outside the scope of business knowledge modeling:
`Debug`, `Platform`, `Process` and `Task`.

Apart from the modules mentioned above you can use everything that's available in `elm/core/1.0.5` without importing
the `Morphir SDK`. The Elm frontend will simply map those to the corresponding type/function names in the Morphir SDK.

The `Morphir SDK` also provides some features beyond `elm/core/1.0.5`. To use those features you have to import the
specific `Morphir SDK` module. Modules that extends `elm/core` will implement the same functions so in general you can
use an alias if you want to switch from the `elm/core` module to the `Morphir SDK` version. For example if you want to
use extended `List` functions you can do the below an all existing code should continue to work without changes:

```elm
import Morphir.SDK.List as List
```

## Morphir IR

The `Morphir.IR` module defines a type-safe API to work with Morphir's intermediate representation. The module
structure follows the structure of the IR. Here's a list of concepts in a top-down approach:

- [Package](https://package.elm-lang.org/packages/Morgan-Stanley/morphir-elm/latest/Morphir-IR-Package) represents an
entire library or application that is versioned as a whole. A package is made up of several modules.
- [Module](https://package.elm-lang.org/packages/Morgan-Stanley/morphir-elm/latest/Morphir-IR-Module) is a container
to group types and values.
- [Types](https://package.elm-lang.org/packages/Morgan-Stanley/morphir-elm/latest/Morphir-IR-Type) allow you to describe
your domain model.
- [Values](https://package.elm-lang.org/packages/Morgan-Stanley/morphir-elm/latest/Morphir-IR-Value) allows you to
describe your business logic.
- [Names](https://package.elm-lang.org/packages/Morgan-Stanley/morphir-elm/latest/Morphir-IR-Name) provide a naming
convention agnostic representation for all nodes that can be named: types, values, modules and packages. Names can be
composed into hierarchies:
- [path](https://package.elm-lang.org/packages/Morgan-Stanley/morphir-elm/latest/Morphir-IR-Path) is a list of names
- [qualifield name](https://package.elm-lang.org/packages/Morgan-Stanley/morphir-elm/latest/Morphir-IR-QName) is a module path with a local name
- [fully-qualifield name](https://package.elm-lang.org/packages/Morgan-Stanley/morphir-elm/latest/Morphir-IR-FQName) is a package path with a qualified name
- [AccessControlled](https://package.elm-lang.org/packages/Morgan-Stanley/morphir-elm/latest/Morphir-IR-AccessControlled)
is a utility to define visibility constraints for modules, types and values