[{"name":"Install.ClauseInCase","comment":" Add a clause to a case expression in a specified function\nin a specified module. For example, if you put the code below in your\n`ReviewConfig.elm` file, running `elm-review --fix` will add the clause\n`ResetCounter` to the `updateFromFrontend` function in the `Backend` module.\n\n    -- code for ReviewConfig.elm:\n    Install.ClauseInCase.init \"Backend\" \"updateFromFrontend\" \"ResetCounter\" \"( { model | counter = 0 }, broadcast (CounterNewValue 0 clientId) )\"\n        |> Install.ClauseInCase.makeRule\n\n    Thus we will have\n\n    updateFromFrontend : SessionId -> ClientId -> ToBackend -> Model -> ( Model, Cmd BackendMsg )\n    updateFromFrontend sessionId clientId msg model =\n        case msg of\n            CounterIncremented ->\n            ...\n            CounterDecremented ->\n            ...\n            ResetCounter ->\n                ( { model | counter = 0 }, broadcast (CounterNewValue 0 clientId) )\n\n    You also can add the clause after another clause of choice with the `withInsertAfter` function:\n        Install.ClauseInCase.init \"Backend\" \"updateFromFrontend\" \"ResetCounter\" \"( { model | counter = 0 }, broadcast (CounterNewValue 0 clientId) )\"\n            |> Install.ClauseInCase.withInsertAfter \"CounterIncremented\"\n            |> Install.ClauseInCase.makeRule\n\n    In this case we will have\n        updateFromFrontend : SessionId -> ClientId -> ToBackend -> Model -> ( Model, Cmd BackendMsg )\n        updateFromFrontend sessionId clientId msg model =\n            case msg of\n                CounterIncremented ->\n                ...\n                ResetCounter ->\n                    ( { model | counter = 0 }, broadcast (CounterNewValue 0 clientId) )\n\n                CounterDecremented ->\n                ...\n    You can also customize the error message with the `withCustomErrorMessage` function:\n        Install.ClauseInCase.init \"Backend\" \"updateFromFrontend\" \"ResetCounter\" \"( { model | counter = 0 }, broadcast (CounterNewValue 0 clientId) )\"\n            |> Install.ClauseInCase.withCustomErrorMessage \"Add handler for ResetCounter\" []\n            |> Install.ClauseInCase.makeRule\n\n@docs init, makeRule, withInsertAfter, withInsertAtBeginning, withCustomErrorMessage, Config, CustomError\n\n","unions":[{"name":"Config","comment":" Configuration for makeRule: add a clause to a case expression in a specified function in a specified module.\n","args":[],"cases":[]},{"name":"CustomError","comment":" Custom error message to be displayed when running `elm-review --fix` or `elm-review --fix-all`\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"init","comment":" Basic config to add a new clause to a case expression. If you just need to add a new clause at the end of the case, you can simply use it with the `makeRule` function like this:\n\n    Install.ClauseInCase.init \"Backend\" \"updateFromFrontend\" \"ResetCounter\" \"( { model | counter = 0 }, broadcast (CounterNewValue 0 clientId) )\"\n        |> Install.ClauseInCase.makeRule\n    If you need additional configuration, check the `withInsertAfter` and `withCustomErrorMessage` functions.\n\n","type":"String.String -> String.String -> String.String -> String.String -> Install.ClauseInCase.Config"},{"name":"makeRule","comment":" Create a makeRule that adds a clause to a case expression in a specified function. You can use it like this:\n\n    Install.ClauseInCase.init \"Backend\" \"updateFromFrontend\" \"ResetCounter\" \"( { model | counter = 0 }, broadcast (CounterNewValue 0 clientId) )\"\n        |> Install.ClauseInCase.makeRule\n\n","type":"Install.ClauseInCase.Config -> Review.Rule.Rule"},{"name":"withCustomErrorMessage","comment":" Customize the error message that will be displayed when running `elm-review --fix` or `elm-review --fix-all`\n","type":"String.String -> List.List String.String -> Install.ClauseInCase.Config -> Install.ClauseInCase.Config"},{"name":"withInsertAfter","comment":" Add a clause after another clause of choice in a case expression. If the clause to insert after is not found, the new clause will be inserted at the end.\n\n\n## Example\n\nGiven the following module:\n\n    module Philosopher exposing (Philosopher(..), stringToPhilosopher)\n\n    type Philosopher\n        = Socrates\n        | Plato\n        | Aristotle\n\n    stringToPhilosopher : String -> Maybe Philosopher\n    stringToPhilosopher str =\n        case str of\n            \"Socrates\" ->\n                Just Socrates\n\n            \"Plato\" ->\n                Just Plato\n\n            \"Aristotle\" ->\n                Just Aristotle\n\n            _ ->\n                Nothing\n\nTo add the clause `Aspasia` after the clause `Aristotle`, you can use the following configuration:\n\n    Install.ClauseInCase.init \"Philosopher\" \"stringToPhilosopher\" \"Aspasia\" \"Just Aspasia\"\n        |> Install.ClauseInCase.withInsertAfter \"Aristotle\"\n        |> Install.ClauseInCase.makeRule\n\nThis will add the clause `Aspasia` after the clause `Aristotle` in the `stringToPhilosopher` function, resulting in:\n\n    stringToPhilosopher : String -> Maybe Philosopher\n    stringToPhilosopher str =\n        case str of\n            \"Socrates\" ->\n                Just Socrates\n\n            \"Plato\" ->\n                Just Plato\n\n            \"Aristotle\" ->\n                Just Aristotle\n\n            \"Aspasia\" ->\n                Just Aspasia\n\n            _ ->\n                Nothing\n\n","type":"String.String -> Install.ClauseInCase.Config -> Install.ClauseInCase.Config"},{"name":"withInsertAtBeginning","comment":" Add a clause at the beginning of the case expression.\n","type":"Install.ClauseInCase.Config -> Install.ClauseInCase.Config"}],"binops":[]},{"name":"Install.FieldInTypeAlias","comment":" Add a field to specified type alias\nin a specified module. For example, if you put the code below in your\n`ReviewConfig.elm` file, running `elm-review` will add the field\n`quot: String` to the type alias `FrontendModel` in the `Types` module.\n\n    -- code for ReviewConfig.elm:\n    Install.FieldInTypeAlias.makeRule \"Types\" \"FrontendModel\" \"quot: String\"\n\nThus we will have\n\n    type alias FrontendModel =\n        { counter : Int\n        , clientId : String\n        , quot : String\n        }\n\n@docs makeRule\n\n","unions":[],"aliases":[],"values":[{"name":"makeRule","comment":" Create a rule that adds a field to a type alias in a specified module. Example usage:\n\n    module Types exposing (FrontendModel)\n\n    type alias FrontendModel =\n        { counter : Int\n        , clientId : String\n        }\n\nAfter running the rule with the following code:\n\n    Install.FieldInTypeAlias.makeRule \"Types\" \"FrontendModel\" \"quot: String\"\n\n        type alias FrontendModel =\n            { counter : Int\n            , clientId : String\n            , quot : String\n            }\n\n","type":"String.String -> String.String -> String.String -> Review.Rule.Rule"}],"binops":[]},{"name":"Install.Function.InsertFunction","comment":" Add a function in a given module if it is not present.\n\n    -- code for ReviewConfig.elm:\n    rule =\n        Install.Function.InsertFunction.init\n            \"Frontend\"\n            \"view\"\n            \"\"\"view model =\n            Html.text \"This is a test\\\"\"\"\"\n            |> Install.Function.InsertFunction.makeRule\n\nRunning this rule will insert the function `view` in the module `Frontend` with the provided implementation.\n\nThe form of the rule is the same for nested modules:\n\n    rule =\n        Install.Function.InsertFunction.init\n            \"Foo.Bar\"\n            \"earnInterest\"\n            \"hoho model = { model | interest = 1.03 * model.interest }\"\n            |> Install.Function.InsertFunction.makeRule\n\n@docs makeRule, init, Config, CustomError, withInsertAfter\n\n","unions":[{"name":"Config","comment":" Configuration for makeRule: add a function in a specified module if it does not already exist.\n","args":[],"cases":[]},{"name":"CustomError","comment":" Custom error message to be displayed when running `elm-review --fix` or `elm-review --fix-all`\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"init","comment":" Initialize the configuration for the rule.\n","type":"String.String -> String.String -> String.String -> Install.Function.InsertFunction.Config"},{"name":"makeRule","comment":" Create a rule that adds a function in a given module if it is not present.\n","type":"Install.Function.InsertFunction.Config -> Review.Rule.Rule"},{"name":"withInsertAfter","comment":" Add the function after a specified declaration. Just give the name of a function, type, type alias or port and the function will be added after that declaration. Only work if the function is being added and not replaced.\n","type":"String.String -> Install.Function.InsertFunction.Config -> Install.Function.InsertFunction.Config"}],"binops":[]},{"name":"Install.Function.ReplaceFunction","comment":" Replace a function in a given module with a new implementation.\n\n    -- code for ReviewConfig.elm:\n    rule =\n        Install.Function.InsertFunction.init\n            \"Frontend\"\n            \"view\"\n            \"\"\"view model =\n            Html.text \"This is a test\\\"\"\"\"\n            |> Install.Function.InsertFunction.makeRule\n\nRunning this rule will replace the function `view` in the module `Frontend` with the provided implementation.\n\nThe form of the rule is the same for nested modules:\n\n    rule =\n        Install.Function.ReplaceFunction.init\n            \"Foo.Bar\"\n            \"earnInterest\"\n            \"hoho model = { model | interest = 1.03 * model.interest }\"\n            |> Install.Function.ReplaceFunction.makeRule\n\n@docs makeRule, init, Config, CustomError\n\n","unions":[{"name":"Config","comment":" Configuration for makeRule: replace a function in a specified module with a new implementation.\n","args":[],"cases":[]},{"name":"CustomError","comment":" Custom error message to be displayed when running `elm-review --fix` or `elm-review --fix-all`\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"init","comment":" Initialize the configuration for the rule.\n","type":"String.String -> String.String -> String.String -> Install.Function.ReplaceFunction.Config"},{"name":"makeRule","comment":" Create a rule that replaces a function in a given module with a new implementation.\n","type":"Install.Function.ReplaceFunction.Config -> Review.Rule.Rule"}],"binops":[]},{"name":"Install.Import","comment":" Add import statements to a given module.\nFor example, to add `import Foo.Bar` to the `Frontend` module, you can use the following configuration:\n\n    Install.Import.init \"Frontend\"\n        [ { moduleToImport = \"Foo.Bar\", alias_ = Nothing, exposedValues = Nothing } ]\n        |> Install.Import.makeRule\n\nTo add the statement `import Foo.Bar as FB exposing (a, b, c)` to the `Frontend` module, do this:\n\n    Install.Import.init \"Frontend\" [ { moduleToImport = \"Foo.Bar\", alias_ = Just \"FB\", exposedValues = Just [ \"a\", \"b\", \"c\" ] } ]\n        |> Install.Import.makeRule\n\nThere is a short cut for importing modules with no alias or exposed values:\n\n    Install.Import.initSimple \"Frontend\" [ \"Foo.Bar\", \"Baz.Qux\" ]\n        |> Install.Import.makeRule\n\n@docs init, initSimple, makeRule\n\n","unions":[],"aliases":[],"values":[{"name":"init","comment":" Initialize the configuration for the rule.\n","type":"String.String -> List.List { moduleToImport : String.String, alias_ : Maybe.Maybe String.String, exposedValues : Maybe.Maybe (List.List String.String) } -> Install.Import.Config"},{"name":"initSimple","comment":" Initialize the configuration for the rule.\n","type":"String.String -> List.List String.String -> Install.Import.Config"},{"name":"makeRule","comment":" Create a rule that adds a list of imports for given modules in a given module.\nSee above for examples.\n","type":"Install.Import.Config -> Review.Rule.Rule"}],"binops":[]},{"name":"Install.Initializer","comment":" Add a field to the body of a function like `init` in which the\nthe return value is of the form `( Model, Cmd msg )`. As in\nthe `ReviewConfig` item below, you specify the module name, the function\nname, as well as the field name and value to be added to the function:\n\n    -- code for ReviewConfig.elm:\n    gcd\n\nThus we will have/.l\n\n     init : ( Model, Cmd BackendMsg )\n     init =\n         ( { counter = 0\n           , message = \"hohoho!\"\n           }\n         , Cmd.none\n         )\n\n@docs makeRule\n\n","unions":[],"aliases":[],"values":[{"name":"makeRule","comment":" Create a rule that adds a field to the body of a function like\n`init` in which the return value is of the form `( Model, Cmd msg )`.\nAs in the `ReviewConfig` item below, you specify\nthe module name, the function name, as well as the\nfield name and value to be added to the function:\n\n    Install.Initializer.makeRule \"Backend\" \"init\" \"message\" \"\\\"hohoho!\\\"\"\n\n","type":"String.String -> String.String -> String.String -> String.String -> Review.Rule.Rule"}],"binops":[]},{"name":"Install.InitializerCmd","comment":" Consider a function whose return value is of the form `( _, Cmd.none )`.\nSuppose given a list of commands, e.g. `[foo, bar]`. The function\n`makeRule` described below replaces `Cmd.none` by `Cmd.batch [ foo, bar ]`.\n\n@docs makeRule\n\n","unions":[],"aliases":[],"values":[{"name":"makeRule","comment":" Consider a function whose return value is of the form `( _, Cmd.none )`.\nSuppose given a list of commands, e.g. `[foo, bar]`. The function\n`makeRule` creates a rule that replaces `Cmd.none` by `Cmd.batch [ foo, bar ]`.\nFor example, the rule\n\n    Install.InitializerCmd.makeRule \"A.B\" \"init\" [ \"foo\", \"bar\" ]\n\nresults in the following fix for function `A.B.init`:\n\n    Cmd.none -> (Cmd.batch [ foo, bar ])\n\n","type":"String.String -> String.String -> List.List String.String -> Review.Rule.Rule"}],"binops":[]},{"name":"Install.Subscription","comment":" Use this rule to add to the list of subscriptions.\n\n@docs makeRule\n\n","unions":[],"aliases":[],"values":[{"name":"makeRule","comment":" Suppose that you have\n\n    subscriptions =\n        Sub.batch [ foo, bar ]\n\nand that you want to add `baz` to the list. To do this, say\n\n    Insall.Subscription.makeRule \"Badkend\" \"baz\"\n\nThe result is\n\n    subscriptions =\n        Sub.batch [ foo, bar, baz ]\n\n","type":"String.String -> String.String -> Review.Rule.Rule"}],"binops":[]},{"name":"Install.Type","comment":" `Install.Type` provides a rule that checks if a type is present\nin the given module and if not, it adds it right after the imports.\n\nFor example, the rule\n\n          Install.Type.makeRule \"Frontend\" \"Magic\" [ \"Inactive\", \"Wizard String\", \"Spell String Int\"]\n\nresults in insertion the text below in the module \"Frontend\":\n\n          type Magic\n              = Inactive\n              | Wizard String\n              | Spell String Int\n\n@docs makeRule\n\n","unions":[],"aliases":[],"values":[{"name":"makeRule","comment":" Rule to add a type to a module if it is not present\n","type":"String.String -> String.String -> List.List String.String -> Review.Rule.Rule"}],"binops":[]},{"name":"Install.TypeVariant","comment":" Add a variant to a given type in a given module. As in\nthe `ReviewConfig` item below, you specify the module name, the type\nname, and the type of the new variant.\n\n    Install.TypeVariant.makeRule \"Types\" \"ToBackend\" \"ResetCounter\"\n\nThen you will have\n\n     type ToBackend\n         = CounterIncremented\n         | CounterDecremented\n         | ResetCounter\n\nwhere the last variant is the one added.\n\n@docs makeRule\n\n","unions":[],"aliases":[],"values":[{"name":"makeRule","comment":" Create a rule that adds a variant to a type in a specified module:\n\n    Install.TypeVariant.makeRule \"Types\" \"ToBackend\" \"ResetCounter\"\n\n","type":"String.String -> String.String -> String.String -> Review.Rule.Rule"}],"binops":[]}]