elm-review rule to make sure that type variables which are only used once are highlighted 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 -_
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 youre used to this, it can be really nice, similar to
at :
Nat (ArgIn _ minLengthMinus1 _)
-> LinearDirection
-> Arr (In (Nat1Plus minLengthMinus1) _) element
-> elementwhich sadly doesn't exist 😢
OnlyAllSingleUseTypeVarsEndWith_module ReviewConfig exposing (config)
import OnlyAllSingleUseTypeVarsEndWith_
import Review.Rule exposing (Rule)
config : List Rule
config =
[ OnlyAllSingleUseTypeVarsEndWith_.rule
]When you already use the -_ suffix in (multi-use) type variables.