lue-bird/elm-review-single-use-type-vars-end-with-underscore - version: 2.0.3

for more information visit the package's GitHub page

Package contains the following modules:

elm-review-single-use-type-vars-end-with-underscore

elm-review rule to make sure that type variables on module scope declarations which are only used once are marked with the suffix -_.

why would you want this?

-_ at the end of a type variable is a good indication that it is used only in this one place.

Some types have a lot of type variables, most of them only used once. If you see a -_

example

Which one is easier to understand?

at :
    Nat (ArgIn indexMin minLengthMinus1 indexIfN)
    -> LinearDirection
    -> Arr (In (Nat1Plus minLengthMinus1) maxLength) element
    -> element
at :
    Nat (ArgIn indexMin_ minLengthMinus1 indexIfN_)
    -> LinearDirection
    -> Arr (In (Nat1Plus minLengthMinus1) maxLength_) element
    -> element

(from typesafe-array: Arr.at)

Once you're used to this, it feels similar to

at :
    Nat (ArgIn _ minLengthMinus1 _)
    -> LinearDirection
    -> Arr (In (Nat1Plus minLengthMinus1) _) element
    -> element

Provided rules

🔧OnlyAllSingleUseTypeVarsEndWith_ reports in types of module scope declarations

Configuration

module ReviewConfig exposing (config)

import OnlyAllSingleUseTypeVarsEndWith_
import Review.Rule exposing (Rule)

config : List Rule
config =
    [ OnlyAllSingleUseTypeVarsEndWith_.rule
    ]

Why you might not want this

Ultimately, the solution to fix all three would be an editor extension that de-emphasizes (less contrast, ...) single-use type variables.