Type accesses cleanup: do not thread the generics seen and limit 'let rec' use
Summary:
The `gen_seen` was needlessly passed around in the local 'env'. Only data
which has to be mutated needs to be passed around this way.
In this diff I make it clear that `gen_seen` is simply passed downwards the
call stack, and can only grow with recursive calls. That is the typical
pattern to detect cycles when navigating a graph.
I also re-ordered the functions to not abuse the 'let rec' construct and make
it clear which functions call which.
Finally, I inlined `expand_with_env_` in `expand_with_env`.
Reviewed By: dlreeves
Differential Revision:
D19091338
fbshipit-source-id:
bc987902fbfef8b817a17c73d401143bda5456bd