for more information visit the package's GitHub page
Package contains the following modules:
elm-review
rule
to make sure that type variables on module scope declarations
which are only used once
are marked with the suffix -_.
-_ 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 -_
you know not to focus on these
through the review rule you can make sure that this type variable isn't used anywhere else → 2 type variables can't accidentally be the same.
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
🔧OnlyAllSingleUseTypeVarsEndWith_
reports in types of module scope declarations
module ReviewConfig exposing (config)
import OnlyAllSingleUseTypeVarsEndWith_
import Review.Rule exposing (Rule)
config : List Rule
config =
[ OnlyAllSingleUseTypeVarsEndWith_.rule
]
Ultimately, the solution to fix all three would be an editor extension that de-emphasizes (less contrast, ...) single-use type variables.