From 8cf3b11606ce3746d7d46f46b9dfb71b5ff006a1 Mon Sep 17 00:00:00 2001 From: Stephen Goldbaum Date: Tue, 7 Jul 2020 17:04:12 -0400 Subject: [PATCH 1/5] cleanup the examples and build --- morphir.json | 44 ++- package-lock.json | 6 +- src/Morphir/SDK/App.elm | 46 --- src/Morphir/SDK/Average.elm | 20 -- src/Morphir/SDK/Basics.elm | 557 --------------------------------- src/Morphir/SDK/DictExtra.elm | 58 ---- src/Morphir/SDK/ListExtra.elm | 14 - src/Morphir/SDK/MaybeExtra.elm | 12 - src/Morphir/SDK/Rule.elm | 93 ------ 9 files changed, 34 insertions(+), 816 deletions(-) delete mode 100644 src/Morphir/SDK/App.elm delete mode 100644 src/Morphir/SDK/Average.elm delete mode 100644 src/Morphir/SDK/Basics.elm delete mode 100644 src/Morphir/SDK/DictExtra.elm delete mode 100644 src/Morphir/SDK/ListExtra.elm delete mode 100644 src/Morphir/SDK/MaybeExtra.elm delete mode 100644 src/Morphir/SDK/Rule.elm diff --git a/morphir.json b/morphir.json index 1831167..f058a00 100644 --- a/morphir.json +++ b/morphir.json @@ -1,15 +1,33 @@ { - "name": "Morphir", - "sourceDirectory": "src", - "exposedModules": [ - "IR.Name", - "IR.Path", - "IR.QName", - "IR.FQName", - "IR.AccessControlled", - "IR.Type", - "IR.Value", - "IR.Module", - "IR.Package" - ] + "name": "Morphir.Sample", + "sourceDirectory": "src", + "exposedModules": + [ "Apps/Shared/Client" + , "Apps/Shared/Market" + , "Apps/Shared/Price" + , "Apps/Shared/Product" + , "Apps/Shared/Quantity" + , "Apps/Shared/Rate" + , "Apps/BooksAndRecords/App" + , "Apps/BooksAndRecords/Deal" + , "Apps/Order/ACL" + , "Apps/Order/App" + , "Apps/Order/Order" + , "Apps/Trader/App" + , "Apps/Trader/Logic" + , "Apps/Upstream/Market/App" + , "Apps/Upstream/Product/App" + , "Apps/Upstream/Trading/App" + , "LCR/Basics" + , "LCR/Calculations" + , "LCR/Counterparty" + , "LCR/Flows" + , "LCR/Inflows" + , "LCR/MaturityBucket" + , "LCR/Outflows" + , "LCR/Product" + , "LCR/Rules" + , "Rules/Direct" + , "Rules/RuleSet" + ] } diff --git a/package-lock.json b/package-lock.json index e25bef8..2b459b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,9 +9,9 @@ "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==" }, "morphir-elm": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/morphir-elm/-/morphir-elm-0.4.0.tgz", - "integrity": "sha512-stW0jqM0Qk2zTh8LVRC3adG55MfmZxoCKxz+hSfw2xFVmwcKH352PFuhKE9m2Mo7AY2j0p9C/XOHd0ggYS0L9w==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/morphir-elm/-/morphir-elm-0.6.0.tgz", + "integrity": "sha512-65UFxZYwYk67pglr8tgalNpiQwXt9Tpht3xKZFUq6tjuz2vz2I2k5nUI1RvCQdqxcgncs3Y83BUOJ33zdUvQJA==", "requires": { "commander": "^4.1.1" } diff --git a/src/Morphir/SDK/App.elm b/src/Morphir/SDK/App.elm deleted file mode 100644 index 2fb182b..0000000 --- a/src/Morphir/SDK/App.elm +++ /dev/null @@ -1,46 +0,0 @@ -module Morphir.SDK.App exposing (..) - - -type StatelessApp remotestate view = - StatelessApp (remotestate -> view) - - -statelessApp : (remotestate -> view) -> StatelessApp remotestate view -statelessApp f = - StatelessApp f - - -type StatefulApp api remotestate localstate event = - StatefulApp - { api : remotestate -> localstate -> api - , init : remotestate -> ( localstate, Cmd event ) - , update : remotestate -> event -> localstate -> ( localstate, Cmd event ) - , subscriptions : remotestate -> localstate -> Sub event - } - - -sendCommand : (api -> Result x event) -> (Maybe x -> List a) -> StatefulApp api remotestate localstate event -> Cmd a -sendCommand command mapResult app = - Cmd.none - - -subscribe : (localstate -> localstate -> List a) -> StatefulApp api remotestate localstate event -> Sub a -subscribe query app = - Sub.none - - -statefulApp : - { api : remotestate -> localstate -> api - , init : remotestate -> ( localstate, Cmd event ) - , update : remotestate -> event -> localstate -> ( localstate, Cmd event ) - , subscriptions : remotestate -> localstate -> Sub event - } - -> StatefulApp api remotestate localstate event -statefulApp app = - StatefulApp app - - -{-| Just a helper for readability -} -cmdNone : a -> (a, Cmd msg) -cmdNone a = - (a, Cmd.none) \ No newline at end of file diff --git a/src/Morphir/SDK/Average.elm b/src/Morphir/SDK/Average.elm deleted file mode 100644 index b10d405..0000000 --- a/src/Morphir/SDK/Average.elm +++ /dev/null @@ -1,20 +0,0 @@ -module Morphir.SDK.Average exposing (..) - - -weighted : (a -> Float) -> (a -> Float) -> List a -> Maybe Float -weighted getWeight getValue list = - if List.isEmpty list then - Nothing - else - let - totalWeight = - list - |> List.map getWeight - |> List.sum - - totalWeightedValue = - list - |> List.map (\a -> getWeight a * getValue a) - |> List.sum - in - Just (totalWeightedValue / totalWeight) \ No newline at end of file diff --git a/src/Morphir/SDK/Basics.elm b/src/Morphir/SDK/Basics.elm deleted file mode 100644 index b09313f..0000000 --- a/src/Morphir/SDK/Basics.elm +++ /dev/null @@ -1,557 +0,0 @@ -module Morphir.SDK.Basics exposing - ( Int8, Int16, Int32, Int64, Float32, Float64, Decimal - , add, sub, mul, fdiv, idiv, pow - , toDecimal, round, floor, ceiling, truncate - , eq, neq - , lt, gt, le, ge, max, min, compare, Order - , not, and, or, xor - , append - , modBy, remainderBy, negate, abs, clamp, sqrt - , toString - , identity, always, pipeLeft, pipeRight, composeLeft, composeRight - ) - - -{-| Tons of useful functions that get imported by default. -# Math -@docs Int, Decimal, add, sub, mul, fdiv, idiv, pow -# Int to Decimal / Decimal to Int -@docs toDecimal, round, floor, ceiling, truncate -# Equality -@docs eq, neq -# Comparison -These functions only work on `comparable` types. This includes numbers, -characters, strings, lists of comparable things, and tuples of comparable -things. -@docs lt, gt, le, ge, max, min, compare, Order -# Booleans -@docs Bool, not, and, or, xor -# Append Strings and Lists -@docs append -# Fancier Math -@docs modBy, remainderBy, negate, abs, clamp, sqrt -# Function Helpers -@docs identity, always, apL, apR, composeL, composeR --} - -import Morphir.Core.Native exposing (Native, native) -import Morphir.Core.Annotation exposing (undefined) - --- MATHEMATICS - - -{-| Represents an 8 bit integer value. --} -type alias Int8 = - Native Int - - -{-| Represents a 16 bit integer value. --} -type alias Int16 = - Native Int - - -{-| Represents a 32 bit integer value. --} -type alias Int32 = - Native Int - - -{-| Represents a 64 bit integer value. --} -type alias Int64 = - Native Int - - -{-| Represents a 32 bit floating-point value. --} -type alias Float32 = - Native Float - - -{-| Represents a 64 bit floating-point value. --} -type alias Float64 = - Native Float - - -{-| Represents a Decimal number. Backed by Float in Elm for simplicity but -in all other backends it uses decimal arithmetices as expected. --} -type alias Decimal = - Native Float - - -{-| Add two numbers. The `number` type variable means this operation can be -specialized to `Int -> Int -> Int` or to `Float -> Float -> Float`. So you -can do things like this: - 3002 + 4004 == 7006 -- all ints - 3.14 + 3.14 == 6.28 -- all floats -You _cannot_ add an `Int` and a `Float` directly though. Use functions like -[toFloat](#toFloat) or [round](#round) to convert both values to the same type. -So if you needed to add a list length to a `Float` for some reason, you -could say one of these: - 3.14 + toFloat (List.length [1,2,3]) == 6.14 - round 3.14 + List.length [1,2,3] == 6 -**Note:** Languages like Java and JavaScript automatically convert `Int` values -to `Float` values when you mix and match. This can make it difficult to be sure -exactly what type of number you are dealing with. When you try to _infer_ these -conversions (as Scala does) it can be even more confusing. Elm has opted for a -design that makes all conversions explicit. --} -add : number -> number -> number -add a b = - native (a + b) - - -{-| Subtract numbers like `4 - 3 == 1`. -See [`(+)`](#+) for docs on the `number` type variable. --} -sub : number -> number -> number -sub a b = - native (a - b) - - -{-| Multiply numbers like `2 * 3 == 6`. -See [`(+)`](#+) for docs on the `number` type variable. --} -mul : number -> number -> number -mul a b = - native (a * b) - - -{-| Floating-point division: - 3.14 / 2 == 1.57 --} -fdiv : rational -> rational -> rational -fdiv a b = - undefined - - -{-| Integer division: - 3 // 2 == 1 -Notice that the remainder is discarded. --} -idiv : Int -> Int -> Int -idiv a b = - native (a // b) - - -{-| Exponentiation - 3^2 == 9 - 3^3 == 27 --} -pow : number -> number -> number -pow a b = - native (a ^ b) - - - --- INT TO DECIMAL / DECIMAL TO INT - - -{-| Convert an integer into a decimal. Useful when mixing `Int` and `Decimal` -values like this: - halfOf : Int -> Decimal - halfOf number = - toDecimal number / 2 --} -toDecimal : Int -> Decimal -toDecimal a = - native (Basics.toFloat a) - - -{-| Turn any kind of value into a string. When you view the resulting string -with `Text.fromString` it should look just like the value it came from. - - toString 42 == "42" - toString [1,2] == "[1,2]" - toString "he said, \"hi\"" == "\"he said, \\\"hi\\\"\"" --} -toString : a -> String -toString a = - native (Debug.toString a) - -{-| Round a number to the nearest integer. - round 1.0 == 1 - round 1.2 == 1 - round 1.5 == 2 - round 1.8 == 2 - round -1.2 == -1 - round -1.5 == -1 - round -1.8 == -2 --} -round : Decimal -> Int -round a = - native (Basics.round a) - - -{-| Floor function, rounding down. - floor 1.0 == 1 - floor 1.2 == 1 - floor 1.5 == 1 - floor 1.8 == 1 - floor -1.2 == -2 - floor -1.5 == -2 - floor -1.8 == -2 --} -floor : Decimal -> Int -floor a = - native (Basics.floor a) - - -{-| Ceiling function, rounding up. - ceiling 1.0 == 1 - ceiling 1.2 == 2 - ceiling 1.5 == 2 - ceiling 1.8 == 2 - ceiling -1.2 == -1 - ceiling -1.5 == -1 - ceiling -1.8 == -1 --} -ceiling : Decimal -> Int -ceiling a = - native (Basics.ceiling a) - - -{-| Truncate a number, rounding towards zero. - truncate 1.0 == 1 - truncate 1.2 == 1 - truncate 1.5 == 1 - truncate 1.8 == 1 - truncate -1.2 == -1 - truncate -1.5 == -1 - truncate -1.8 == -1 --} -truncate : Decimal -> Int -truncate a = - native (Basics.truncate a) - - - --- EQUALITY - - -{-| Check if values are “the same”. -**Note:** Elm uses structural equality on tuples, records, and user-defined -union types. This means the values `(3, 4)` and `(3, 4)` are definitely equal. -This is not true in languages like JavaScript that use reference equality on -objects. -**Note:** Equality (in the Elm sense) is not possible for certain types. For -example, the functions `(\n -> n + 1)` and `(\n -> 1 + n)` are “the -same” but detecting this in general is [undecidable][]. In a future -release, the compiler will detect when `(==)` is used with problematic -types and provide a helpful error message. This will require quite serious -infrastructure work that makes sense to batch with another big project, so the -stopgap is to crash as quickly as possible. Problematic types include functions -and JavaScript values like `Json.Encode.Value` which could contain functions -if passed through a port. -[undecidable]: https://en.wikipedia.org/wiki/Undecidable_problem --} -eq : a -> a -> Bool -eq a b = - native (a == b) - - -{-| Check if values are not “the same”. -So `(a /= b)` is the same as `(not (a == b))`. --} -neq : a -> a -> Bool -neq a b = - native (a /= b) - - - --- COMPARISONS - - -{-|-} -lt : comparable -> comparable -> Bool -lt a b = - native (a < b) - - -{-|-} -gt : comparable -> comparable -> Bool -gt a b = - native (a > b) - - -{-|-} -le : comparable -> comparable -> Bool -le a b = - native (a <= b) - - -{-|-} -ge : comparable -> comparable -> Bool -ge a b = - native (a >= b) - - -{-| Find the smaller of two comparables. - min 42 12345678 == 42 - min "abc" "xyz" == "abc" --} -min : comparable -> comparable -> comparable -min x y = - native (Basics.min x y) - - -{-| Find the larger of two comparables. - max 42 12345678 == 12345678 - max "abc" "xyz" == "xyz" --} -max : comparable -> comparable -> comparable -max x y = - native (Basics.max x y) - - -{-| Compare any two comparable values. Comparable values include `String`, -`Char`, `Int`, `Float`, or a list or tuple containing comparable values. These -are also the only values that work as `Dict` keys or `Set` members. - compare 3 4 == LT - compare 4 4 == EQ - compare 5 4 == GT --} -compare : comparable -> comparable -> Order -compare a b = - native (Basics.compare a b) - - -{-| Represents the relative ordering of two things. -The relations are less than, equal to, and greater than. --} -type alias Order = - Native Basics.Order - - - --- BOOLEANS - - - -{-| Negate a boolean value. - not True == False - not False == True --} -not : Bool -> Bool -not a = - native (Basics.not a) - - -{-| The logical AND operator. `True` if both inputs are `True`. - True && True == True - True && False == False - False && True == False - False && False == False -**Note:** When used in the infix position, like `(left && right)`, the operator -short-circuits. This means if `left` is `False` we do not bother evaluating `right` -and just return `False` overall. --} -and : Bool -> Bool -> Bool -and a b = - native (a && b) - - -{-| The logical OR operator. `True` if one or both inputs are `True`. - True || True == True - True || False == True - False || True == True - False || False == False -**Note:** When used in the infix position, like `(left || right)`, the operator -short-circuits. This means if `left` is `True` we do not bother evaluating `right` -and just return `True` overall. --} -or : Bool -> Bool -> Bool -or a b = - native (a || b) - - -{-| The exclusive-or operator. `True` if exactly one input is `True`. - xor True True == False - xor True False == True - xor False True == True - xor False False == False --} -xor : Bool -> Bool -> Bool -xor a b = - native (Basics.xor a b) - - - --- APPEND - - -{-| Put two appendable things together. This includes strings, lists, and text. - "hello" ++ "world" == "helloworld" - [1,1,2] ++ [3,5,8] == [1,1,2,3,5,8] --} -append : appendable -> appendable -> appendable -append a b = - native (a ++ b) - - - --- FANCIER MATH - -{-| Perform [modular arithmetic](https://en.wikipedia.org/wiki/Modular_arithmetic). -A common trick is to use (n mod 2) to detect even and odd numbers: - modBy 2 0 == 0 - modBy 2 1 == 1 - modBy 2 2 == 0 - modBy 2 3 == 1 -Our `modBy` function works in the typical mathematical way when you run into -negative numbers: - List.map (modBy 4) [ -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 ] - -- [ 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1 ] -Use [`remainderBy`](#remainderBy) for a different treatment of negative numbers, -or read Daan Leijen’s [Division and Modulus for Computer Scientists][dm] for more -information. -[dm]: https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/divmodnote-letter.pdf --} -modBy : Int -> Int -> Int -modBy a b = - native (Basics.modBy a b) - - -{-| Get the remainder after division. Here are bunch of examples of dividing by four: - List.map (remainderBy 4) [ -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 ] - -- [ -1, 0, -3, -2, -1, 0, 1, 2, 3, 0, 1 ] -Use [`modBy`](#modBy) for a different treatment of negative numbers, -or read Daan Leijen’s [Division and Modulus for Computer Scientists][dm] for more -information. -[dm]: https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/divmodnote-letter.pdf --} -remainderBy : Int -> Int -> Int -remainderBy a b = - native (Basics.remainderBy a b) - - -{-| Negate a number. - - negate 42 == -42 - negate -42 == 42 - negate 0 == 0 --} -negate : number -> number -negate n = - native (Basics.negate n) - - -{-| Get the [absolute value][abs] of a number. - abs 16 == 16 - abs -4 == 4 - abs -8.5 == 8.5 - abs 3.14 == 3.14 -[abs]: https://en.wikipedia.org/wiki/Absolute_value --} -abs : number -> number -abs n = - native (Basics.abs n) - - -{-| Clamps a number within a given range. With the expression -`clamp 100 200 x` the results are as follows: - 100 if x < 100 - x if 100 <= x < 200 - 200 if 200 <= x --} -clamp : number -> number -> number -> number -clamp low high number = - native (Basics.clamp low high number) - - -{-| Take the square root of a number. - sqrt 4 == 2 - sqrt 9 == 3 - sqrt 16 == 4 - sqrt 25 == 5 --} -sqrt : Decimal -> Decimal -sqrt a = - native (Basics.sqrt a) - - - --- FUNCTION HELPERS - - -{-| Function composition, passing results along in the suggested direction. For -example, the following code checks if the square root of a number is odd: - not << isEven << sqrt -You can think of this operator as equivalent to the following: - (g << f) == (\x -> g (f x)) -So our example expands out to something like this: - \n -> not (isEven (sqrt n)) --} -composeLeft : (b -> c) -> (a -> b) -> (a -> c) -composeLeft g f x = - g (f x) - - -{-| Function composition, passing results along in the suggested direction. For -example, the following code checks if the square root of a number is odd: - sqrt >> isEven >> not --} -composeRight : (a -> b) -> (b -> c) -> (a -> c) -composeRight f g x = - g (f x) - - -{-| Saying `x |> f` is exactly the same as `f x`. -It is called the “pipe” operator because it lets you write “pipelined” code. -For example, say we have a `sanitize` function for turning user input into -integers: - -- BEFORE - sanitize : String -> Maybe Int - sanitize input = - String.toInt (String.trim input) -We can rewrite it like this: - -- AFTER - sanitize : String -> Maybe Int - sanitize input = - input - |> String.trim - |> String.toInt -Totally equivalent! I recommend trying to rewrite code that uses `x |> f` -into code like `f x` until there are no pipes left. That can help you build -your intuition. -**Note:** This can be overused! I think folks find it quite neat, but when you -have three or four steps, the code often gets clearer if you break out a -top-level helper function. Now the transformation has a name. The arguments are -named. It has a type annotation. It is much more self-documenting that way! -Testing the logic gets easier too. Nice side benefit! --} -pipeRight : a -> (a -> b) -> b -pipeRight x f = - f x - - -{-| Saying `f <| x` is exactly the same as `f x`. -It can help you avoid parentheses, which can be nice sometimes. Maybe you want -to apply a function to a `case` expression? That sort of thing. --} -pipeLeft : (a -> b) -> a -> b -pipeLeft f x = - f x - - -{-| Given a value, returns exactly the same value. This is called -[the identity function](https://en.wikipedia.org/wiki/Identity_function). --} -identity : a -> a -identity x = - x - - -{-| Create a function that *always* returns the same value. Useful with -functions like `map`: - List.map (always 0) [1,2,3,4,5] == [0,0,0,0,0] - -- List.map (\_ -> 0) [1,2,3,4,5] == [0,0,0,0,0] - -- always = (\x _ -> x) --} -always : a -> b -> a -always a _ = - a \ No newline at end of file diff --git a/src/Morphir/SDK/DictExtra.elm b/src/Morphir/SDK/DictExtra.elm deleted file mode 100644 index a56bf17..0000000 --- a/src/Morphir/SDK/DictExtra.elm +++ /dev/null @@ -1,58 +0,0 @@ -module Morphir.SDK.DictExtra exposing (..) - - -import Dict exposing (Dict) - - -filterMap : (comparable -> a -> Maybe b) -> Dict comparable a -> Dict comparable b -filterMap f dict = - dict - |> Dict.toList - |> List.filterMap - (\( k, a ) -> - f k a - |> Maybe.map (\v -> ( k, v )) - ) - |> Dict.fromList - - -getAndThen : Dict comparable a -> comparable -> (a -> Maybe b) -> Maybe b -getAndThen dict key f = - dict - |> Dict.get key - |> Maybe.andThen f - - -getMap : Dict comparable a -> comparable -> (a -> b) -> Maybe b -getMap dict key f = - dict - |> Dict.get key - |> Maybe.map f - - -type DictEvent comparable v - = Insert comparable v - | Update comparable v v - | Delete comparable v - - -changes : Dict comparable v -> Dict comparable v -> List (DictEvent comparable v) -changes dict1 dict2 = - [] -- TODO: implement - - -filterByKey : (comparable -> Bool) -> List (DictEvent comparable v) -> List (DictEvent comparable v) -filterByKey f list = - list - |> List.filter - (\change -> - case change of - Insert key _ -> - f key - - Update key _ _ -> - f key - - Delete key _ -> - f key - ) \ No newline at end of file diff --git a/src/Morphir/SDK/ListExtra.elm b/src/Morphir/SDK/ListExtra.elm deleted file mode 100644 index 9ca4af6..0000000 --- a/src/Morphir/SDK/ListExtra.elm +++ /dev/null @@ -1,14 +0,0 @@ -module Morphir.SDK.ListExtra exposing (get) - - -{-| Get the item at an index in the List or Nothing if the index is out of range. - get 10 [] == Nothing - get -1 [1,2,3] == Nothing - get 1 [1,2,3] == Just 2 --} -get : Int -> List a -> Maybe a -get index list = - if index < 0 then - Nothing - else - list |> List.drop (index - 1) |> List.head diff --git a/src/Morphir/SDK/MaybeExtra.elm b/src/Morphir/SDK/MaybeExtra.elm deleted file mode 100644 index 6114405..0000000 --- a/src/Morphir/SDK/MaybeExtra.elm +++ /dev/null @@ -1,12 +0,0 @@ -module Morphir.SDK.MaybeExtra exposing (toList) - - -{-| Return an empty list on `Nothing` or a list with one element, where the element is the value of `Just`. - maybeToList Nothing == [] - maybeToList (Just 1) == [1] --} -toList : Maybe a -> List a -toList m = - case m of - Nothing -> [] - Just x -> [x] diff --git a/src/Morphir/SDK/Rule.elm b/src/Morphir/SDK/Rule.elm deleted file mode 100644 index c335a57..0000000 --- a/src/Morphir/SDK/Rule.elm +++ /dev/null @@ -1,93 +0,0 @@ -module Morphir.SDK.Rule exposing (..) - - -type RuleSet a b - = RuleSet (List (a -> Maybe b)) - - -decide : a -> RuleSet a b -> Maybe b -decide data (RuleSet rules) = - case rules of - [] -> - Nothing - - firstRule :: rest -> - case firstRule data of - Just result -> - Just result - - Nothing -> - decide data (RuleSet rest) - - -matchThenMap : (a -> Bool) -> (a -> b) -> a -> Maybe b -matchThenMap f g a = - if f a then - Just (g a) - else - Nothing - - -type PriorityRuleSet a b - = PriorityRuleSet (List ( (a -> Maybe b), Int )) - - -type RuleCollision a b - = RuleCollision (RuleSet a b) - - -decideByPriority : a -> PriorityRuleSet a b -> Result (RuleCollision a b) (Maybe b) -decideByPriority data (PriorityRuleSet rules) = - let - matchingRules = - rules - |> List.filter - (\( rule, priority ) -> - rule data /= Nothing - ) - - maxPriority = - matchingRules - |> List.map Tuple.second - |> List.maximum - |> Maybe.withDefault 0 - - maxPriorityRules = - matchingRules - |> List.filterMap - (\( rule, priority ) -> - if priority == maxPriority then - Just rule - else - Nothing - ) - in - case maxPriorityRules of - [] -> - Ok Nothing - - [ rule ] -> - Ok (rule data) - - multipleRules -> - Err (RuleCollision (RuleSet multipleRules)) - - -any : a -> Bool -any _ = - True - - -is : a -> a -> Bool -is a b = - a == b - - -anyOf : List a -> a -> Bool -anyOf list a = - List.member a list - - -noneOf : List a -> a -> Bool -noneOf list a = - not (anyOf list a) \ No newline at end of file From 53394307735a3fc64d01caeab498be0de99a4eb0 Mon Sep 17 00:00:00 2001 From: Stephen Goldbaum Date: Wed, 8 Jul 2020 15:11:14 -0400 Subject: [PATCH 2/5] added BooksAndRecords to basic build --- morphir.json | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/morphir.json b/morphir.json index f058a00..b89ad54 100644 --- a/morphir.json +++ b/morphir.json @@ -1,33 +1,7 @@ { - "name": "Morphir.Sample", + "name": "Company/Operations", "sourceDirectory": "src", - "exposedModules": - [ "Apps/Shared/Client" - , "Apps/Shared/Market" - , "Apps/Shared/Price" - , "Apps/Shared/Product" - , "Apps/Shared/Quantity" - , "Apps/Shared/Rate" - , "Apps/BooksAndRecords/App" - , "Apps/BooksAndRecords/Deal" - , "Apps/Order/ACL" - , "Apps/Order/App" - , "Apps/Order/Order" - , "Apps/Trader/App" - , "Apps/Trader/Logic" - , "Apps/Upstream/Market/App" - , "Apps/Upstream/Product/App" - , "Apps/Upstream/Trading/App" - , "LCR/Basics" - , "LCR/Calculations" - , "LCR/Counterparty" - , "LCR/Flows" - , "LCR/Inflows" - , "LCR/MaturityBucket" - , "LCR/Outflows" - , "LCR/Product" - , "LCR/Rules" - , "Rules/Direct" - , "Rules/RuleSet" + "exposedModules": [ + "BooksAndRecords" ] -} +} \ No newline at end of file From cce67066ee1d6af972e2140a83b603b21854c09e Mon Sep 17 00:00:00 2001 From: Stephen Goldbaum Date: Wed, 8 Jul 2020 15:36:37 -0400 Subject: [PATCH 3/5] Some fixes to new StatefulApp structure --- morphir.json.bak | 33 +++++++++++++++++++ .../Sample/Apps/BooksAndRecords/App.elm | 2 +- .../Sample/Apps/BooksAndRecords/Deal.elm | 3 +- src/Morphir/Sample/Apps/Order/App.elm | 2 +- src/Morphir/Sample/Apps/Shared/Price.elm | 4 +-- src/Morphir/Sample/Apps/Trader/App.elm | 2 +- 6 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 morphir.json.bak diff --git a/morphir.json.bak b/morphir.json.bak new file mode 100644 index 0000000..f058a00 --- /dev/null +++ b/morphir.json.bak @@ -0,0 +1,33 @@ +{ + "name": "Morphir.Sample", + "sourceDirectory": "src", + "exposedModules": + [ "Apps/Shared/Client" + , "Apps/Shared/Market" + , "Apps/Shared/Price" + , "Apps/Shared/Product" + , "Apps/Shared/Quantity" + , "Apps/Shared/Rate" + , "Apps/BooksAndRecords/App" + , "Apps/BooksAndRecords/Deal" + , "Apps/Order/ACL" + , "Apps/Order/App" + , "Apps/Order/Order" + , "Apps/Trader/App" + , "Apps/Trader/Logic" + , "Apps/Upstream/Market/App" + , "Apps/Upstream/Product/App" + , "Apps/Upstream/Trading/App" + , "LCR/Basics" + , "LCR/Calculations" + , "LCR/Counterparty" + , "LCR/Flows" + , "LCR/Inflows" + , "LCR/MaturityBucket" + , "LCR/Outflows" + , "LCR/Product" + , "LCR/Rules" + , "Rules/Direct" + , "Rules/RuleSet" + ] +} diff --git a/src/Morphir/Sample/Apps/BooksAndRecords/App.elm b/src/Morphir/Sample/Apps/BooksAndRecords/App.elm index c7324d9..b4da9d6 100644 --- a/src/Morphir/Sample/Apps/BooksAndRecords/App.elm +++ b/src/Morphir/Sample/Apps/BooksAndRecords/App.elm @@ -2,7 +2,7 @@ module Morphir.Sample.Apps.BooksAndRecords.App exposing (..) import Dict exposing (Dict) -import Morphir.SDK.App exposing (StatefulApp, statefulApp, cmdNone) +import Morphir.SDK.StatefulApp exposing (..) import Morphir.Sample.Apps.Shared.Product as Product import Morphir.Sample.Apps.Shared.Price exposing (..) import Morphir.Sample.Apps.BooksAndRecords.Deal exposing (..) diff --git a/src/Morphir/Sample/Apps/BooksAndRecords/Deal.elm b/src/Morphir/Sample/Apps/BooksAndRecords/Deal.elm index 6431c41..79e3cb0 100644 --- a/src/Morphir/Sample/Apps/BooksAndRecords/Deal.elm +++ b/src/Morphir/Sample/Apps/BooksAndRecords/Deal.elm @@ -5,13 +5,12 @@ import Morphir.Sample.Apps.Shared.Product as Product import Morphir.Sample.Apps.Shared.Client as Client import Morphir.Sample.Apps.Shared.Price exposing (..) import Morphir.Sample.Apps.Shared.Quantity exposing (..) -import Morphir.SDK.Basics exposing (Decimal) type alias ID = String -type alias Value = Decimal +type alias Value = Float type alias Deal = diff --git a/src/Morphir/Sample/Apps/Order/App.elm b/src/Morphir/Sample/Apps/Order/App.elm index fe63b2c..efe22ae 100644 --- a/src/Morphir/Sample/Apps/Order/App.elm +++ b/src/Morphir/Sample/Apps/Order/App.elm @@ -9,7 +9,7 @@ module Morphir.Sample.Apps.Order.App exposing import Dict exposing (Dict) -import Morphir.SDK.App exposing (StatefulApp, statefulApp, cmdNone) +import Morphir.SDK.StatefulApp exposing (StatefulApp, statefulApp, cmdNone) import Morphir.Sample.Apps.Shared.Product as Product import Morphir.Sample.Apps.BooksAndRecords.Deal as Deal import Morphir.Sample.Apps.Order.Order as Order diff --git a/src/Morphir/Sample/Apps/Shared/Price.elm b/src/Morphir/Sample/Apps/Shared/Price.elm index aea39fa..5a157e4 100644 --- a/src/Morphir/Sample/Apps/Shared/Price.elm +++ b/src/Morphir/Sample/Apps/Shared/Price.elm @@ -1,7 +1,5 @@ module Morphir.Sample.Apps.Shared.Price exposing (..) -import SDK.Basics exposing (Decimal) - -type alias Price = Decimal \ No newline at end of file +type alias Price = Float \ No newline at end of file diff --git a/src/Morphir/Sample/Apps/Trader/App.elm b/src/Morphir/Sample/Apps/Trader/App.elm index c4de82b..2f3e8a2 100644 --- a/src/Morphir/Sample/Apps/Trader/App.elm +++ b/src/Morphir/Sample/Apps/Trader/App.elm @@ -3,7 +3,7 @@ module Morphir.Sample.Apps.Trader.App exposing (..) import Morphir.Sample.Apps.Trader.Logic exposing (..) import Dict exposing (Dict) -import Morphir.SDK.App exposing (StatefulApp, statefulApp, cmdNone) +import Morphir.SDK.StatefulApp exposing (StatefulApp, statefulApp, cmdNone) import Morphir.Sample.Apps.Shared.Product as Product import Morphir.Sample.Apps.BooksAndRecords.App as BookApp import Morphir.Sample.Apps.BooksAndRecords.Deal as Deal From fc299a33347896ead0b77fadc12d0e6d88bdfb04 Mon Sep 17 00:00:00 2001 From: Stephen Goldbaum Date: Mon, 10 Aug 2020 12:16:17 -0400 Subject: [PATCH 4/5] Added file headers --- package.json | 3 +++ publisher/node-publisher.js | 16 ++++++++++++++++ publisher/node-server.js | 17 +++++++++++++++++ src/Company/Operations/BooksAndRecords.elm | 18 ++++++++++++++++++ .../Sample/Apps/Approvals/Inventory/App.elm | 16 ++++++++++++++++ .../Sample/Apps/Approvals/LocateList/ACL.elm | 16 ++++++++++++++++ .../Sample/Apps/Approvals/LocateList/App.elm | 16 ++++++++++++++++ .../Sample/Apps/BooksAndRecords/App.elm | 16 ++++++++++++++++ .../Sample/Apps/BooksAndRecords/Deal.elm | 16 ++++++++++++++++ src/Morphir/Sample/Apps/Order/ACL.elm | 16 ++++++++++++++++ src/Morphir/Sample/Apps/Order/App.elm | 15 +++++++++++++++ src/Morphir/Sample/Apps/Order/Order.elm | 15 +++++++++++++++ src/Morphir/Sample/Apps/Rates/ACL.elm | 16 ++++++++++++++++ src/Morphir/Sample/Apps/Rates/App.elm | 16 ++++++++++++++++ src/Morphir/Sample/Apps/Shared/Client.elm | 16 ++++++++++++++++ src/Morphir/Sample/Apps/Shared/Market.elm | 16 ++++++++++++++++ src/Morphir/Sample/Apps/Shared/Price.elm | 16 ++++++++++++++++ src/Morphir/Sample/Apps/Shared/Product.elm | 16 ++++++++++++++++ src/Morphir/Sample/Apps/Shared/Quantity.elm | 16 ++++++++++++++++ src/Morphir/Sample/Apps/Shared/Rate.elm | 16 ++++++++++++++++ src/Morphir/Sample/Apps/Trader/App.elm | 16 ++++++++++++++++ src/Morphir/Sample/Apps/Trader/Logic.elm | 16 ++++++++++++++++ .../Sample/Apps/Upstream/Market/App.elm | 16 ++++++++++++++++ .../Sample/Apps/Upstream/Product/App.elm | 16 ++++++++++++++++ .../Sample/Apps/Upstream/Trading/App.elm | 16 ++++++++++++++++ src/Morphir/Sample/LCR/Basics.elm | 16 ++++++++++++++++ src/Morphir/Sample/LCR/Calculations.elm | 16 ++++++++++++++++ src/Morphir/Sample/LCR/Counterparty.elm | 16 ++++++++++++++++ src/Morphir/Sample/LCR/Flows.elm | 16 ++++++++++++++++ src/Morphir/Sample/LCR/Inflows.elm | 16 ++++++++++++++++ src/Morphir/Sample/LCR/MaturityBucket.elm | 16 ++++++++++++++++ src/Morphir/Sample/LCR/Outflows.elm | 16 ++++++++++++++++ src/Morphir/Sample/LCR/Product.elm | 16 ++++++++++++++++ src/Morphir/Sample/LCR/Rules.elm | 16 ++++++++++++++++ src/Morphir/Sample/Rules/Direct.elm | 16 ++++++++++++++++ src/Morphir/Sample/Rules/RuleSet.elm | 16 ++++++++++++++++ tests/Morphir/Sample/Apps/Rates/AppTests.elm | 16 ++++++++++++++++ tests/Morphir/Sample/LCR/FedSampleTest.elm | 16 ++++++++++++++++ tests/Morphir/Sample/LCR/RulesTest.elm | 16 ++++++++++++++++ 39 files changed, 612 insertions(+) diff --git a/package.json b/package.json index e8299e8..dbefa7e 100644 --- a/package.json +++ b/package.json @@ -5,5 +5,8 @@ ], "devDependencies": { "@morphir/morphir-elm": "latest" + }, + "dependencies": { + "morphir-elm": "^0.6.0" } } diff --git a/publisher/node-publisher.js b/publisher/node-publisher.js index 357bdca..5d1c295 100644 --- a/publisher/node-publisher.js +++ b/publisher/node-publisher.js @@ -1,3 +1,19 @@ +/* +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + const readline = require('readline') const http = require('http') diff --git a/publisher/node-server.js b/publisher/node-server.js index 675579a..a19b7c2 100644 --- a/publisher/node-server.js +++ b/publisher/node-server.js @@ -1,3 +1,20 @@ +/* +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + + const express = require('express') const app = express() diff --git a/src/Company/Operations/BooksAndRecords.elm b/src/Company/Operations/BooksAndRecords.elm index 9a528f5..fee9d67 100644 --- a/src/Company/Operations/BooksAndRecords.elm +++ b/src/Company/Operations/BooksAndRecords.elm @@ -1,3 +1,21 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + + + module Company.Operations.BooksAndRecords exposing (..) import Morphir.SDK.StatefulApp exposing (StatefulApp) diff --git a/src/Morphir/Sample/Apps/Approvals/Inventory/App.elm b/src/Morphir/Sample/Apps/Approvals/Inventory/App.elm index a31df33..a370d8f 100644 --- a/src/Morphir/Sample/Apps/Approvals/Inventory/App.elm +++ b/src/Morphir/Sample/Apps/Approvals/Inventory/App.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.Approvals.Inventory.App exposing (..) diff --git a/src/Morphir/Sample/Apps/Approvals/LocateList/ACL.elm b/src/Morphir/Sample/Apps/Approvals/LocateList/ACL.elm index a9167d6..c43719d 100644 --- a/src/Morphir/Sample/Apps/Approvals/LocateList/ACL.elm +++ b/src/Morphir/Sample/Apps/Approvals/LocateList/ACL.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.Approvals.LocateList.ACL exposing (..) diff --git a/src/Morphir/Sample/Apps/Approvals/LocateList/App.elm b/src/Morphir/Sample/Apps/Approvals/LocateList/App.elm index ca41c61..b3511a7 100644 --- a/src/Morphir/Sample/Apps/Approvals/LocateList/App.elm +++ b/src/Morphir/Sample/Apps/Approvals/LocateList/App.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.Approvals.LocateList.App exposing (..) diff --git a/src/Morphir/Sample/Apps/BooksAndRecords/App.elm b/src/Morphir/Sample/Apps/BooksAndRecords/App.elm index b4da9d6..c552067 100644 --- a/src/Morphir/Sample/Apps/BooksAndRecords/App.elm +++ b/src/Morphir/Sample/Apps/BooksAndRecords/App.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.BooksAndRecords.App exposing (..) diff --git a/src/Morphir/Sample/Apps/BooksAndRecords/Deal.elm b/src/Morphir/Sample/Apps/BooksAndRecords/Deal.elm index 79e3cb0..033bfda 100644 --- a/src/Morphir/Sample/Apps/BooksAndRecords/Deal.elm +++ b/src/Morphir/Sample/Apps/BooksAndRecords/Deal.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.BooksAndRecords.Deal exposing (..) diff --git a/src/Morphir/Sample/Apps/Order/ACL.elm b/src/Morphir/Sample/Apps/Order/ACL.elm index 7cdb651..0a372cd 100644 --- a/src/Morphir/Sample/Apps/Order/ACL.elm +++ b/src/Morphir/Sample/Apps/Order/ACL.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.Order.ACL exposing (..) diff --git a/src/Morphir/Sample/Apps/Order/App.elm b/src/Morphir/Sample/Apps/Order/App.elm index efe22ae..44dc56a 100644 --- a/src/Morphir/Sample/Apps/Order/App.elm +++ b/src/Morphir/Sample/Apps/Order/App.elm @@ -1,3 +1,18 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} module Morphir.Sample.Apps.Order.App exposing ( App , API diff --git a/src/Morphir/Sample/Apps/Order/Order.elm b/src/Morphir/Sample/Apps/Order/Order.elm index 18cca9b..1790ac1 100644 --- a/src/Morphir/Sample/Apps/Order/Order.elm +++ b/src/Morphir/Sample/Apps/Order/Order.elm @@ -1,3 +1,18 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} module Morphir.Sample.Apps.Order.Order exposing (..) diff --git a/src/Morphir/Sample/Apps/Rates/ACL.elm b/src/Morphir/Sample/Apps/Rates/ACL.elm index 278164b..096a317 100644 --- a/src/Morphir/Sample/Apps/Rates/ACL.elm +++ b/src/Morphir/Sample/Apps/Rates/ACL.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.Rates.ACL exposing (..) {-| This module is our anti-corruption layer that translates external states into an diff --git a/src/Morphir/Sample/Apps/Rates/App.elm b/src/Morphir/Sample/Apps/Rates/App.elm index 24c99e0..60748c3 100644 --- a/src/Morphir/Sample/Apps/Rates/App.elm +++ b/src/Morphir/Sample/Apps/Rates/App.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.Rates.App exposing (..) import Dict exposing (Dict) diff --git a/src/Morphir/Sample/Apps/Shared/Client.elm b/src/Morphir/Sample/Apps/Shared/Client.elm index 8cb356e..903e2cd 100644 --- a/src/Morphir/Sample/Apps/Shared/Client.elm +++ b/src/Morphir/Sample/Apps/Shared/Client.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.Shared.Client exposing (..) diff --git a/src/Morphir/Sample/Apps/Shared/Market.elm b/src/Morphir/Sample/Apps/Shared/Market.elm index 21b2589..94b71cc 100644 --- a/src/Morphir/Sample/Apps/Shared/Market.elm +++ b/src/Morphir/Sample/Apps/Shared/Market.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.Shared.Market exposing (..) diff --git a/src/Morphir/Sample/Apps/Shared/Price.elm b/src/Morphir/Sample/Apps/Shared/Price.elm index 5a157e4..2fa5ec7 100644 --- a/src/Morphir/Sample/Apps/Shared/Price.elm +++ b/src/Morphir/Sample/Apps/Shared/Price.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.Shared.Price exposing (..) diff --git a/src/Morphir/Sample/Apps/Shared/Product.elm b/src/Morphir/Sample/Apps/Shared/Product.elm index 1f9f084..eb9430b 100644 --- a/src/Morphir/Sample/Apps/Shared/Product.elm +++ b/src/Morphir/Sample/Apps/Shared/Product.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.Shared.Product exposing (..) diff --git a/src/Morphir/Sample/Apps/Shared/Quantity.elm b/src/Morphir/Sample/Apps/Shared/Quantity.elm index 21cf2c5..91c30c2 100644 --- a/src/Morphir/Sample/Apps/Shared/Quantity.elm +++ b/src/Morphir/Sample/Apps/Shared/Quantity.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.Shared.Quantity exposing (..) diff --git a/src/Morphir/Sample/Apps/Shared/Rate.elm b/src/Morphir/Sample/Apps/Shared/Rate.elm index 65cce2a..89784e8 100644 --- a/src/Morphir/Sample/Apps/Shared/Rate.elm +++ b/src/Morphir/Sample/Apps/Shared/Rate.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.Shared.Rate exposing (..) diff --git a/src/Morphir/Sample/Apps/Trader/App.elm b/src/Morphir/Sample/Apps/Trader/App.elm index 2f3e8a2..72fbf6a 100644 --- a/src/Morphir/Sample/Apps/Trader/App.elm +++ b/src/Morphir/Sample/Apps/Trader/App.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.Trader.App exposing (..) diff --git a/src/Morphir/Sample/Apps/Trader/Logic.elm b/src/Morphir/Sample/Apps/Trader/Logic.elm index 7193c35..9bee0e0 100644 --- a/src/Morphir/Sample/Apps/Trader/Logic.elm +++ b/src/Morphir/Sample/Apps/Trader/Logic.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.Trader.Logic exposing (..) diff --git a/src/Morphir/Sample/Apps/Upstream/Market/App.elm b/src/Morphir/Sample/Apps/Upstream/Market/App.elm index c6f8e43..01c3c9b 100644 --- a/src/Morphir/Sample/Apps/Upstream/Market/App.elm +++ b/src/Morphir/Sample/Apps/Upstream/Market/App.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.Upstream.Market.App exposing (..) {-| This is a stub for an external Market app. Normally this would diff --git a/src/Morphir/Sample/Apps/Upstream/Product/App.elm b/src/Morphir/Sample/Apps/Upstream/Product/App.elm index 3412ed6..59d8037 100644 --- a/src/Morphir/Sample/Apps/Upstream/Product/App.elm +++ b/src/Morphir/Sample/Apps/Upstream/Product/App.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.Upstream.Product.App exposing (..) diff --git a/src/Morphir/Sample/Apps/Upstream/Trading/App.elm b/src/Morphir/Sample/Apps/Upstream/Trading/App.elm index a7758f5..c974e6d 100644 --- a/src/Morphir/Sample/Apps/Upstream/Trading/App.elm +++ b/src/Morphir/Sample/Apps/Upstream/Trading/App.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.Upstream.Trading.App exposing (..) diff --git a/src/Morphir/Sample/LCR/Basics.elm b/src/Morphir/Sample/LCR/Basics.elm index 5f80bb5..358de05 100644 --- a/src/Morphir/Sample/LCR/Basics.elm +++ b/src/Morphir/Sample/LCR/Basics.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.LCR.Basics exposing ( AssetCategoryCodes(..) , InsuranceType(..) diff --git a/src/Morphir/Sample/LCR/Calculations.elm b/src/Morphir/Sample/LCR/Calculations.elm index 378c8ff..a7df89d 100644 --- a/src/Morphir/Sample/LCR/Calculations.elm +++ b/src/Morphir/Sample/LCR/Calculations.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.LCR.Calculations exposing (..) diff --git a/src/Morphir/Sample/LCR/Counterparty.elm b/src/Morphir/Sample/LCR/Counterparty.elm index ebd1b94..87c64dd 100644 --- a/src/Morphir/Sample/LCR/Counterparty.elm +++ b/src/Morphir/Sample/LCR/Counterparty.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.LCR.Counterparty exposing (..) diff --git a/src/Morphir/Sample/LCR/Flows.elm b/src/Morphir/Sample/LCR/Flows.elm index 505c732..59ec2b2 100644 --- a/src/Morphir/Sample/LCR/Flows.elm +++ b/src/Morphir/Sample/LCR/Flows.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.LCR.Flows exposing (..) diff --git a/src/Morphir/Sample/LCR/Inflows.elm b/src/Morphir/Sample/LCR/Inflows.elm index 851050f..81cdba3 100644 --- a/src/Morphir/Sample/LCR/Inflows.elm +++ b/src/Morphir/Sample/LCR/Inflows.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.LCR.Inflows exposing (..) diff --git a/src/Morphir/Sample/LCR/MaturityBucket.elm b/src/Morphir/Sample/LCR/MaturityBucket.elm index 8e44716..861434e 100644 --- a/src/Morphir/Sample/LCR/MaturityBucket.elm +++ b/src/Morphir/Sample/LCR/MaturityBucket.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.LCR.MaturityBucket exposing (..) diff --git a/src/Morphir/Sample/LCR/Outflows.elm b/src/Morphir/Sample/LCR/Outflows.elm index 871b2ae..4b5d544 100644 --- a/src/Morphir/Sample/LCR/Outflows.elm +++ b/src/Morphir/Sample/LCR/Outflows.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.LCR.Outflows exposing (..) diff --git a/src/Morphir/Sample/LCR/Product.elm b/src/Morphir/Sample/LCR/Product.elm index 275d4bc..d6dc9b6 100644 --- a/src/Morphir/Sample/LCR/Product.elm +++ b/src/Morphir/Sample/LCR/Product.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.LCR.Product exposing (..) diff --git a/src/Morphir/Sample/LCR/Rules.elm b/src/Morphir/Sample/LCR/Rules.elm index 812c8d2..fd0e0d6 100644 --- a/src/Morphir/Sample/LCR/Rules.elm +++ b/src/Morphir/Sample/LCR/Rules.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.LCR.Rules exposing (..) diff --git a/src/Morphir/Sample/Rules/Direct.elm b/src/Morphir/Sample/Rules/Direct.elm index b73cafe..e253de5 100644 --- a/src/Morphir/Sample/Rules/Direct.elm +++ b/src/Morphir/Sample/Rules/Direct.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Rules.Direct exposing (..) diff --git a/src/Morphir/Sample/Rules/RuleSet.elm b/src/Morphir/Sample/Rules/RuleSet.elm index a53075e..081fe9c 100644 --- a/src/Morphir/Sample/Rules/RuleSet.elm +++ b/src/Morphir/Sample/Rules/RuleSet.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Rules.RuleSet exposing (Trade, Category, ruleSet) diff --git a/tests/Morphir/Sample/Apps/Rates/AppTests.elm b/tests/Morphir/Sample/Apps/Rates/AppTests.elm index 3b718b8..392ede1 100644 --- a/tests/Morphir/Sample/Apps/Rates/AppTests.elm +++ b/tests/Morphir/Sample/Apps/Rates/AppTests.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.Apps.Rates.AppTests exposing (..) {-| Rates calculation tests. diff --git a/tests/Morphir/Sample/LCR/FedSampleTest.elm b/tests/Morphir/Sample/LCR/FedSampleTest.elm index 00ac1b4..e62fdb7 100644 --- a/tests/Morphir/Sample/LCR/FedSampleTest.elm +++ b/tests/Morphir/Sample/LCR/FedSampleTest.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.LCR.FedSampleTest exposing (..) {-| Test based on LCR examples. diff --git a/tests/Morphir/Sample/LCR/RulesTest.elm b/tests/Morphir/Sample/LCR/RulesTest.elm index ad9322a..14df5f0 100644 --- a/tests/Morphir/Sample/LCR/RulesTest.elm +++ b/tests/Morphir/Sample/LCR/RulesTest.elm @@ -1,3 +1,19 @@ +{- +Copyright 2020 Morgan Stanley + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-} + module Morphir.Sample.LCR.RulesTest exposing (..) {-| Tests the Rules structure. From 9fade81f18b6cfbe803cf485607356282b4ab6cb Mon Sep 17 00:00:00 2001 From: Stephen Goldbaum Date: Mon, 10 Aug 2020 12:35:49 -0400 Subject: [PATCH 5/5] finos project files --- CODE_OF_CONDUCT.md | 76 +++++++++++++++++ CONTRIBUTING.md | 143 ++++++++++++++++++++++++++++++++ LICENSE copy | 201 +++++++++++++++++++++++++++++++++++++++++++++ LICENSE.spdx | 7 ++ NOTICE | 8 +- 5 files changed, 432 insertions(+), 3 deletions(-) create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE copy create mode 100644 LICENSE.spdx diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..5ba36cc --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at morphir-dev [at] morganstanley.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..63906ae --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,143 @@ +# Contributing + +When contributing to this repository, please first discuss the change you wish +to make via issue, email, or any other method with the owners of this repository +before making a change. + +Please note we have a code of conduct, please follow it in all your interactions +with the project. + +## Before your first pull request + +If you have not previously contributed to the project, +you must first create a *Developer Certificate of Origin* (“DCO”) and include a +reference to this DCO in each of your commits. In addition, if you subsequently +wish to contribute code having a different copyright ownership, then you must create +a new DCO for such contribution. + +To create a DCO please follow these steps: + +1. For code you are contributing, determine who is/are the copyright owner(s). +Please note that your employer may own the copyright in code you have written even +where the code was not created during regular working hours. Copyright law is +variable from jurisdiction to jurisdiction. Accordingly, consult your employer +or a lawyer if you are not sure. +2. Fill out the [DCO] replacing all `<>` terms as appropriate, and place the +completed DCO in a file under `dco/` or if you are not the copyright +holder then in a file under `dco/-`. + 1. Please note that the name you provide (``) must be your real + (legal) name; we will not accept aliases, pseudonyms or anonymous + contributions. + 1. If you’ve determined that the copyright holder of the code that you’ve + written is an entity other than yourself (e.g., your employer), then + include the legal name of the copyright holder(s) (``). + You must ensure that you are authorized by the copyright holder(s) to be able + to grant the licenses under the DCO for the purpose of contributing to the + project. Negotiating such authorization and administering the terms is + entirely between you and the copyright holder(s). +3. Issue a pull request with the DCO. + +## Pull request process + +When you create a pull request, follow these steps: + +1. Your commit message for the code you are submitting must include a +`“Covered by “` line which indicates your acceptance of the DCO terms and conditions. +`` here is the file name of the DCO. +2. Your commit must include a change to the `NOTICE.txt` file that contains complete +details of any applicable copyright notice for your submission and including any +applicable third party license(s) or other restrictions associated with any part +of your contribution, and of all matters required to be disclosed under such third +party license(s) (such as any applicable copyright, patent, trademark, and attribution +notices, and any notices relating to modifications made to open source software). +Note your contribution must retain all applicable copyright, patent, trademark and +attribution notices. + +## Pull request guidelines + +* Update the `README.md` docs with details of changes to API, behaviour, features, or usage. +Include useful file locations and relevant documentation. +* Update an existing or add a new testcase for your change. +* Ensure any install or build artefacts are removed from the pull request. +* We generally prefer squashed commits, unless multi-commits add clarity or are +required for mixed copyright commits. +* You may merge the Pull Request in once the build has passed and you have the sign-off +of one other developer, or if you do not have permission to do that, you may request the +reviewer to merge it for you. + + +## Code of Conduct + +### Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +### Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +### Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +### Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +### Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at morphir-dev [at] morganstanley.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +### Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ +[DCO]: dco/dco_template.md diff --git a/LICENSE copy b/LICENSE copy new file mode 100644 index 0000000..8dada3e --- /dev/null +++ b/LICENSE copy @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/LICENSE.spdx b/LICENSE.spdx new file mode 100644 index 0000000..4977b23 --- /dev/null +++ b/LICENSE.spdx @@ -0,0 +1,7 @@ +SPDXVersion: SPDX-2.0 +DataLicense: CC0-1.0 +Creator: Morgan Stanley +PackageName: Morphir +PackageOriginator: Morgan Stanley +PackageHomePage: https://github.com/finos/morphir +PackageLicenseDeclared: Apache-2.0 diff --git a/NOTICE b/NOTICE index 53824ff..ad14fb0 100644 --- a/NOTICE +++ b/NOTICE @@ -1,3 +1,5 @@ -Morphir -Copyright 2020 Morgan Stanley. -This product includes software developed at Morgan Stanley. \ No newline at end of file +Morphir - FINOS +Copyright 2014 - 2020 Morgan Stanley + +This product includes software developed at the Fintech Open Source Foundation (https://www.finos.org/). +This product includes software developed at Morgan Stanley.