[{"name":"Exercises","comment":"\n\n\n# Ellie Elements\n\nThese are the elements used inside Ellie to build an exercise.\n\n@docs exercise, exerciseWithTea, Flags, Model, Msg\n\n\n# ExerciseData\n\n@docs ExerciseData, Difficulty\n\n\n# Tests\n\nThese are the same tests of [elm-explorations/test](https://package.elm-lang.org/packages/elm-explorations/test/latest/Expect). Refer to that package for the documentation.\n\n@docs Expectation, equal, notEqual, all, lessThan, atMost, greaterThan, atLeast, FloatingPointTolerance, within, notWithin, true, false, ok, err, equalLists, equalDicts, equalSets, pass, fail, onFail\n\n\n# For internal use\n\n@docs update, viewElement, init, onlyTests, TEA, Index\n\n\n## Codecs\n\n@docs codecExerciseData, codecIndex\n\n","unions":[{"name":"Difficulty","comment":" ","args":[],"cases":[["Easy",[]],["Medium",[]],["Hard",[]],["Undefined",[]]]},{"name":"Msg","comment":" Internal. Exposed to be used in type signatures\n","args":["msgExercise"],"cases":[]}],"aliases":[{"name":"ExerciseData","comment":" This record define an exercise.\n\n  - `id` A sequencial number. It should be the same as the file name. Numbers from 1 to 99 are reserved to the [Ninety-nine Problems, Solved in Elm](https://johncrane.gitbooks.io/ninety-nine-elm-problems/content/).\n  - `ellieId`, The id from the Ellie url\n  - `title` of the exercise. Keep it concise and explicative\n  - `difficulty` level of the exercise\n  - `problem`, a detailed description of the problem\n  - `tests`\n  - `hints`, a list of suggestions that the user can unhide to help him in the process of finding a solution\n  - `dummySolution`, A placeholder for the solution. Be sure that the type signature is correct and that it compiles. Use dummy values as returned values. For example if the function return `List a`, you can return `[]`. If the function return `Maybe a` you can return `Nothing`, etc.\n  - `solutions`, a list of possible solutions\n\n","args":[],"type":"{ id : Basics.Int, ellieId : String.String, title : String.String, difficulty : Exercises.Difficulty, problem : String.String, tests : List.List String.String, hints : List.List String.String, dummySolution : String.String, solutions : List.List String.String }"},{"name":"Expectation","comment":" In this package I change `Expect.Expectation` to `Expectation`\n","args":[],"type":"Expect.Expectation"},{"name":"Flags","comment":" `Flags` are the way to pass details about the exercises to the page.\n\nThey can be either loaded from external scripts, like in this example:\n\n_(HTML)_\n\n```html\n<script src=\"https://elm-exercises.netlify.app/index.js\"></script>\n<script src=\"https://elm-exercises.netlify.app/001.js\"></script>\n<script src=\"https://elm-exercises.netlify.app/start.js\"></script>\n```\n\nOr they can be hard coded, like in this example (See [`ExerciseData`](#ExerciseData) for a detailed explanation of the fields):\n\n_(JavaScript)_\n\n```javascript\nvar app = Elm.Main.init({\n  node: document.getElementById(\"elm\"),\n  flags: {\n    index: JSON.stringify([]),\n    exercise: JSON.stringify(\n      { id: 1            // Exercise ID\n      , title: \"\"        // Title of the exercise\n      , difficulty: Easy // Easy | Medium | Hard | Undefined\n      , problem: \"\"      // Details of the problem to be solved\n      , tests: []        // List of tests\n      , hints: []        // List of hints\n      , solutions: []    // List of solutions\n      , ellie: \"\"        // Ellie ID\n      }\n    )\n  }\n});\n```\n\n","args":[],"type":"{ index : String.String, exerciseData : String.String }"},{"name":"FloatingPointTolerance","comment":" ","args":[],"type":"Expect.FloatingPointTolerance"},{"name":"Index","comment":" ","args":[],"type":"{ id : Basics.Int, title : String.String, difficulty : Exercises.Difficulty, ellieId : String.String }"},{"name":"Model","comment":" Internal. Exposed to be used in type signatures\n","args":["modelExercise"],"type":"Exercises.InternalModel modelExercise"},{"name":"TEA","comment":" ","args":["modelExercise","msgExercise"],"type":"{ init : ( modelExercise, Platform.Cmd.Cmd msgExercise ), view : modelExercise -> Html.Html msgExercise, update : msgExercise -> modelExercise -> ( modelExercise, Platform.Cmd.Cmd msgExercise ), subscriptions : modelExercise -> Platform.Sub.Sub msgExercise, tests : modelExercise -> List.List Exercises.Expectation }"}],"values":[{"name":"all","comment":" ","type":"List.List (subject -> Exercises.Expectation) -> subject -> Exercises.Expectation"},{"name":"atLeast","comment":" ","type":"comparable -> comparable -> Exercises.Expectation"},{"name":"atMost","comment":" ","type":"comparable -> comparable -> Exercises.Expectation"},{"name":"codecExerciseData","comment":" ","type":"Codec.Codec Exercises.ExerciseData"},{"name":"codecIndex","comment":" ","type":"Codec.Codec Exercises.Index"},{"name":"equal","comment":" ","type":"a -> a -> Exercises.Expectation"},{"name":"equalDicts","comment":" ","type":"Dict.Dict comparable a -> Dict.Dict comparable a -> Exercises.Expectation"},{"name":"equalLists","comment":" ","type":"List.List a -> List.List a -> Exercises.Expectation"},{"name":"equalSets","comment":" ","type":"Set.Set comparable -> Set.Set comparable -> Exercises.Expectation"},{"name":"err","comment":" ","type":"Result.Result a b -> Exercises.Expectation"},{"name":"exercise","comment":"\n\n    import Exercises exposing (..)\n\n\n    -- Write a function `last` that returns\n    -- the last element of a list.\n    --\n    last : List a -> Maybe a\n    last xs =\n        -- Your implementation goes here\n        Nothing\n\n    main : Program Flags Model Msg\n    main =\n        exercise\n            -- Your implementation should pass\n            -- these tests\n            [ last [ 1, 2, 3, 4 ] == Just 4\n            , last [ 1 ] == Just 1\n            , last [] == Nothing\n            , last [ 'a', 'b', 'c' ] == Just 'c'\n            ]\n\n","type":"List.List Exercises.Expectation -> Platform.Program Exercises.Flags (Exercises.Model ()) (Exercises.Msg ())"},{"name":"exerciseWithTea","comment":" If the exercise require The Elm Architecure and tests need to access the Model, it is possible to use `exerciseWithTea` instead of the simpler `exercise`. It is the analogue of `Browser.element` but without flags.\n\n    import Exercises exposing (..)\n\n\n    -- Write a function `last` that returns\n    -- the last element of a list.\n    --\n    last : List a -> Maybe a\n    last xs =\n        -- Your implementation goes here\n        Nothing\n\n    main : Program Flags (Model ModelExercise) (Msg MsgExercise)\n    main =\n        exerciseWithTea\n            { tests =\n                -- Your implementation should pass\n                -- these tests\n                \\model ->\n                    [ last [ 1, 2, 3, 4 ] == Just 4\n                    , last [ 1 ] == Just 1\n                    , last [] == Nothing\n                    , last [ 'a', 'b', 'c' ] == Just 'c'\n                    ]\n            , init = init\n            , view = view\n            , update = update\n            , subscriptions = subscriptions\n            }\n\n    -- Following the definitions of\n    -- init, view, update, and subscriptions.\n\n","type":"Exercises.TEA modelExercise msgExercise -> Platform.Program Exercises.Flags (Exercises.Model modelExercise) (Exercises.Msg msgExercise)"},{"name":"fail","comment":" ","type":"String.String -> Exercises.Expectation"},{"name":"false","comment":" ","type":"String.String -> Basics.Bool -> Exercises.Expectation"},{"name":"greaterThan","comment":" ","type":"comparable -> comparable -> Exercises.Expectation"},{"name":"init","comment":" ","type":"Exercises.TEA modelExercise msgExercise -> Exercises.Flags -> ( Exercises.Model modelExercise, Platform.Cmd.Cmd (Exercises.Msg msgExercise) )"},{"name":"lessThan","comment":" ","type":"comparable -> comparable -> Exercises.Expectation"},{"name":"notEqual","comment":" ","type":"a -> a -> Exercises.Expectation"},{"name":"notWithin","comment":" ","type":"Exercises.FloatingPointTolerance -> Basics.Float -> Basics.Float -> Exercises.Expectation"},{"name":"ok","comment":" ","type":"Result.Result a b -> Exercises.Expectation"},{"name":"onFail","comment":" ","type":"String.String -> Exercises.Expectation -> Exercises.Expectation"},{"name":"onlyTests","comment":" ","type":"List.List Exercises.Expectation -> Exercises.TEA () ()"},{"name":"pass","comment":" ","type":"Exercises.Expectation"},{"name":"true","comment":" ","type":"String.String -> Basics.Bool -> Exercises.Expectation"},{"name":"update","comment":" ","type":"Exercises.TEA modelExercise msgExercise -> Exercises.Msg msgExercise -> Exercises.Model modelExercise -> ( Exercises.Model modelExercise, Platform.Cmd.Cmd (Exercises.Msg msgExercise) )"},{"name":"viewElement","comment":" ","type":"Exercises.TEA modelExercise msgExercise -> Exercises.Model modelExercise -> Element.Element (Exercises.Msg msgExercise)"},{"name":"within","comment":" ","type":"Exercises.FloatingPointTolerance -> Basics.Float -> Basics.Float -> Exercises.Expectation"}],"binops":[]}]