diff --git a/implement/test-and-train/elm-interactive-scenarios-core/deconstruct-pattern/context-app/.gitignore b/implement/test-and-train/elm-interactive-scenarios-core/deconstruct-pattern/context-app/.gitignore new file mode 100644 index 00000000..aee98106 --- /dev/null +++ b/implement/test-and-train/elm-interactive-scenarios-core/deconstruct-pattern/context-app/.gitignore @@ -0,0 +1 @@ +/elm-stuff/ diff --git a/implement/test-and-train/elm-interactive-scenarios-core/deconstruct-pattern/context-app/elm.json b/implement/test-and-train/elm-interactive-scenarios-core/deconstruct-pattern/context-app/elm.json new file mode 100644 index 00000000..ce2a08dc --- /dev/null +++ b/implement/test-and-train/elm-interactive-scenarios-core/deconstruct-pattern/context-app/elm.json @@ -0,0 +1,24 @@ +{ + "type": "application", + "source-directories": [ + "src" + ], + "elm-version": "0.19.1", + "dependencies": { + "direct": { + "elm/browser": "1.0.2", + "elm/core": "1.0.5", + "elm/html": "1.0.0" + }, + "indirect": { + "elm/json": "1.1.3", + "elm/time": "1.0.0", + "elm/url": "1.0.0", + "elm/virtual-dom": "1.0.3" + } + }, + "test-dependencies": { + "direct": {}, + "indirect": {} + } +} diff --git a/implement/test-and-train/elm-interactive-scenarios-core/deconstruct-pattern/context-app/src/DemoSyntax.elm b/implement/test-and-train/elm-interactive-scenarios-core/deconstruct-pattern/context-app/src/DemoSyntax.elm new file mode 100644 index 00000000..fb79dc60 --- /dev/null +++ b/implement/test-and-train/elm-interactive-scenarios-core/deconstruct-pattern/context-app/src/DemoSyntax.elm @@ -0,0 +1,44 @@ +module DemoSyntax exposing (..) + +import Syntax + + +type alias NodeContent = + { alfa : Int + , beta : String + } + + +demoRange : Syntax.Range +demoRange = + { start = { row = 1, column = 1 } + , end = { row = 1, column = 2 } + } + + +sumNodeContentAlfa : List (Syntax.Node NodeContent) -> Int +sumNodeContentAlfa nodes = + case nodes of + [] -> + 0 + + node :: rest -> + let + (Syntax.Node _ content) = + node + in + content.alfa + sumNodeContentAlfa rest + + +concatNodeContentBeta : List (Syntax.Node NodeContent) -> String +concatNodeContentBeta nodes = + case nodes of + [] -> + "" + + node :: rest -> + let + (Syntax.Node _ content) = + node + in + content.beta ++ "-" ++ concatNodeContentBeta rest diff --git a/implement/test-and-train/elm-interactive-scenarios-core/deconstruct-pattern/context-app/src/Syntax.elm b/implement/test-and-train/elm-interactive-scenarios-core/deconstruct-pattern/context-app/src/Syntax.elm new file mode 100644 index 00000000..cacce0f1 --- /dev/null +++ b/implement/test-and-train/elm-interactive-scenarios-core/deconstruct-pattern/context-app/src/Syntax.elm @@ -0,0 +1,26 @@ +module Syntax exposing (..) + +{-| Some types from +-} + + +{-| Base representation for a syntax node in a source file. +-} +type Node a + = Node Range a + + +{-| Source location +-} +type alias Location = + { row : Int + , column : Int + } + + +{-| Range for a piece of code with a start and end +-} +type alias Range = + { start : Location + , end : Location + } diff --git a/implement/test-and-train/elm-interactive-scenarios-core/deconstruct-pattern/steps/351/expected-value.txt b/implement/test-and-train/elm-interactive-scenarios-core/deconstruct-pattern/steps/351/expected-value.txt new file mode 100644 index 00000000..d58fedf2 --- /dev/null +++ b/implement/test-and-train/elm-interactive-scenarios-core/deconstruct-pattern/steps/351/expected-value.txt @@ -0,0 +1 @@ +"abc-def-" \ No newline at end of file diff --git a/implement/test-and-train/elm-interactive-scenarios-core/deconstruct-pattern/steps/351/submission.txt b/implement/test-and-train/elm-interactive-scenarios-core/deconstruct-pattern/steps/351/submission.txt new file mode 100644 index 00000000..9c27dfea --- /dev/null +++ b/implement/test-and-train/elm-interactive-scenarios-core/deconstruct-pattern/steps/351/submission.txt @@ -0,0 +1,12 @@ +let + syntaxNodes : List (Syntax.Node DemoSyntax.NodeContent) + syntaxNodes = + [ Syntax.Node + { start = { row = 1, column = 1 }, end = { row = 1, column = 2 } } + { alfa = 123, beta = "abc" } + , Syntax.Node + { start = { row = 1, column = 3 }, end = { row = 1, column = 4 } } + { alfa = 456, beta = "def" } + ] +in +DemoSyntax.concatNodeContentBeta syntaxNodes \ No newline at end of file diff --git a/implement/test-and-train/elm-interactive-scenarios-core/elm-core-list/steps/631/expected-value.txt b/implement/test-and-train/elm-interactive-scenarios-core/elm-core-list/steps/631/expected-value.txt new file mode 100644 index 00000000..3594a5cf --- /dev/null +++ b/implement/test-and-train/elm-interactive-scenarios-core/elm-core-list/steps/631/expected-value.txt @@ -0,0 +1 @@ +[-19,-7,5,11] \ No newline at end of file diff --git a/implement/test-and-train/elm-interactive-scenarios-core/elm-core-list/steps/631/submission.txt b/implement/test-and-train/elm-interactive-scenarios-core/elm-core-list/steps/631/submission.txt new file mode 100644 index 00000000..cad97d2e --- /dev/null +++ b/implement/test-and-train/elm-interactive-scenarios-core/elm-core-list/steps/631/submission.txt @@ -0,0 +1 @@ +List.sortBy identity [ 11, -7, 5, -19 ] \ No newline at end of file diff --git a/implement/test-and-train/elm-interactive-scenarios-core/elm-core-list/steps/633/expected-value.txt b/implement/test-and-train/elm-interactive-scenarios-core/elm-core-list/steps/633/expected-value.txt new file mode 100644 index 00000000..0b6d1c79 --- /dev/null +++ b/implement/test-and-train/elm-interactive-scenarios-core/elm-core-list/steps/633/expected-value.txt @@ -0,0 +1 @@ +[(1,["c"]),(0,["a","b"])] \ No newline at end of file diff --git a/implement/test-and-train/elm-interactive-scenarios-core/elm-core-list/steps/633/submission.txt b/implement/test-and-train/elm-interactive-scenarios-core/elm-core-list/steps/633/submission.txt new file mode 100644 index 00000000..ea3bae57 --- /dev/null +++ b/implement/test-and-train/elm-interactive-scenarios-core/elm-core-list/steps/633/submission.txt @@ -0,0 +1 @@ +List.sortBy (\( _, dependencies ) -> List.length dependencies) [ (0, ["a","b"]), (1, ["c"]) ] \ No newline at end of file