We represent the target language itself as an ideal monad supplied by the
user, and provide a Scope monad transformer for introducing bound
variables in user supplied terms. Users supply a Monad and Traversable
instance, and we traverse to find free variables, and use the Monad to
perform substitution that avoids bound variables.

Scopes introduce bound variables

Scope b f a is an f expression with bound variables in b,
and free variables in a

We store bound variables as their generalized de Bruijn
representation in that we're allowed to lift (using F) an entire
tree rather than only succ individual variables, but we're still
only allowed to do so once per Scope. Weakening trees permits
O(1) weakening and permits more sharing opportunities. Here the
deBruijn 0 is represented by the B constructor of Var, while the
de Bruijn succ (which may be applied to an entire tree!) is handled
by F.

NB: equality and comparison quotient out the distinct F placements
allowed by the generalized de Bruijn representation and return the
same result as a traditional de Bruijn representation would.

Logically you can think of this as if the shape were the traditional
f (Var b a), but the extra f a inside permits us a cheaper lift.