Prefer Strict Generators

View Source
Within comprehensions, avoid <- and <= in favor of <:- and <:=.
Avoid
[ X || X <- a:list()],
<< <<X>> || X <= a:binary() >>
#{K => V || K := V <- a:map()}Prefer
[ X || X <:- a:list()],
<< <<X>> || X <:= a:binary() >>
#{K => V || K := V <:- a:map()}Rationale
Quoting OTP's official documentation:
Using strict generators is a better practice when either strict or relaxed generators work. More details are in Programming Examples.
Options
- None.
Example configuration
{elvis_style, prefer_strict_generators, #{}}