<div dir="ltr">Since Erlang doesn't allow you to rebind a variable in a scope where it's already bound (that becomes a match instead), there is a convention of using numbered variables to denote successive "generations" of some object or state that's intended to be used in a single-threaded or linear way.  For example:<div><br></div><div>foo(X0) -></div><div>  X1 = update(X0),</div><div>  case predicate(X1) of</div><div>    true -></div><div>      X2 = another_update(X1),</div><div>      persist(X2);</div><div>    false -></div><div>     persist(X1)</div><div>  end.</div><div><br></div><div>Here, whenever X(N+1) becomes bound, X(N) should become unused, and it should be an error if X(N) did not become unused.  A variation is that the "final" value is the one without a number suffix.</div><div><br></div><div>Is there any Erlang linter or style checker that can perform these types of checks?</div></div>