jxxcarlson/elm-review-codeinstaller/13.0.0

Install.Function.ReplaceFunction

Replace a function in a given module with a new implementation.

-- code for ReviewConfig.elm:
rule =
    Install.Function.ReplaceFunction.config
        "Frontend"
        "view"
        """view model =
        Html.text "This is a test\""""
        |> Install.Function.ReplaceFunction.makeRule

Running this rule will replace the function view in the module Frontend with the provided implementation.

The form of the rule is the same for nested modules:

rule =
    Install.Function.ReplaceFunction.config
        "Foo.Bar"
        "earnInterest"
        "hoho model = { model | interest = 1.03 * model.interest }"
        |> Install.Function.ReplaceFunction.makeRule
type alias Config =
Config

Configuration for rule: replace a function in a specified module with a new implementation.

config : String -> String -> String -> Config

Initialize the configuration for the rule.