jxxcarlson/elm-review-codeinstaller/6.1.3

NOTE: the latest version is 13.0.0

Install.TypeVariant

Add a variant to a given type in a given module. As in the ReviewConfig item below, you specify the module name, the type name, and the type of the new variant.

Install.TypeVariant.makeRule "Types" "ToBackend" "ResetCounter"

Then you will have

 type ToBackend
     = CounterIncremented
     | CounterDecremented
     | ResetCounter

where the last variant is the one added.

makeRule : String -> String -> String -> Rule

Create a rule that adds a variant to a type in a specified module:

Install.TypeVariant.makeRule "Types" "ToBackend" "ResetCounter"