anchor.diff:  open Fable.AST.Fable.Util
   open System.Collections.Generic
   
  -let rec transformExprTree f e =
  +// TODO: Use trampoline here?
  +let rec visit f e =
       match e with
       | Value kind ->
           match kind with
  -        | Spread e -> Value(Spread(f e))
  -        | TypeRef(e, gen) -> Value(TypeRef(e, List.map (fun (n,e) -> n, f e) gen))
  -        | TupleConst exprs -> Value(TupleConst(List.map f exprs))
  +        | Spread e -> Value(Spread(visit f e))
  +        | TypeRef(e, gen) -> Value(TypeRef(e, List.map (fun (n,e) -> n, visit f e) gen))
  +        | TupleConst exprs -> Value(TupleConst(List.map (visit f) exprs))
           | ArrayConst(kind, t) ->
               match kind with
  -            | ArrayValues exprs -> ArrayConst(ArrayValues(List.map f exprs), t) |> Value
  -            | ArrayAlloc e -> ArrayConst(ArrayAlloc(f e), t) |> Value
  -        | Lambda(args, body, info) -> Value(Lambda(args, f body, info))
  +            | ArrayValues exprs -> ArrayConst(ArrayValues(List.map (visit f) exprs), t) |> Value
  +            | ArrayAlloc e -> ArrayConst(ArrayAlloc(visit f e), t) |> Value
  +        | Lambda(args, body, info) -> Value(Lambda(args, visit f body, info))
           | Null | This | Super | IdentValue _ | ImportRef _
           | NumberConst _ | StringConst _ | BoolConst _ | RegexConst _
           | UnaryOp _ | BinaryOp _ | LogicalOp _ | Emit _ -> e
       | Apply(callee, args, kind, typ, range) ->
  -        Apply(f callee, List.map f args, kind, typ, range)
  +        Apply(visit f callee, List.map (visit f) args, kind, typ, range)
       | Wrapped(expr, t) ->
  -        Wrapped(f expr, t)
  +        Wrapped(visit f expr, t)
       | VarDeclaration (var, expr, isMut, range) ->
  -        VarDeclaration(var, f expr, isMut, range)
  +        VarDeclaration(var, visit f expr, isMut, range)
       | Sequential (exprs, range) ->
  -        Sequential(List.map f exprs, range)
  +        Sequential(List.map (visit f) exprs, range)
       | IfThenElse(cond, thenExpr, elseExpr, r) ->
  -        IfThenElse(f cond, f thenExpr, f elseExpr, r)
  +        IfThenElse(visit f cond, visit f thenExpr, visit f elseExpr, r)
       | Set(callee, prop, value, r) ->
  -        Set(f callee, Option.map f prop, f value, r)
  +        Set(visit f callee, Option.map f prop, visit f value, r)
       | ObjExpr(decls, ifcs, baseClass, r) ->
           let decls = decls |> List.map (fun (m, idents, e) ->
  -                m, idents, f e)
  -        ObjExpr(decls, ifcs, Option.map f baseClass, r)
  +                m, idents, visit f e)
  +        ObjExpr(decls, ifcs, Option.map (visit f) baseClass, r)
       | Loop (kind, r) ->
           match kind with
  -        | While(e1, e2) -> Loop(While(f e1, f e2), r)
  -        | For(i, e1, e2, e3, up) -> Loop(For(i, f e1, f e2, f e3, up), r)
  -        | ForOf(i, e1, e2) -> Loop(ForOf(i, f e1, f e2), r)
  +        | While(e1, e2) -> Loop(While(visit f e1, visit f e2), r)
  +        | For(i, e1, e2, e3, up) -> Loop(For(i, visit f e1, visit f e2, visit f e3, up), r)
  +        | ForOf(i, e1, e2) -> Loop(ForOf(i, visit f e1, visit f e2), r)
       | TryCatch(body, catch, finalizer, r) ->
  -        TryCatch(f body,
  -                 Option.map (fun (i, e) -> i, f e) catch,
  -                 Option.map f finalizer, r)
  +        TryCatch(visit f body,
  +                 Option.map (fun (i, e) -> i, visit f e) catch,
  +                 Option.map (visit f) finalizer, r)
       | Switch(matchValue, cases, defaultCase, t, r) ->
  -        Switch(f matchValue,
  -               List.map (fun (cases, body) -> List.map f cases, f body) cases,
  -               Option.map f defaultCase, t, r)
  -    | Quote e -> Quote(f e)
  -    | Throw(e, t, r) -> Throw(f e, t, r)
  +        Switch(visit f matchValue,
  +               List.map (fun (cases, body) -> List.map (visit f) cases, visit f body) cases,
  +               Option.map (visit f) defaultCase, t, r)
  +    | Quote e -> Quote(visit f e)
  +    | Throw(e, t, r) -> Throw(visit f e, t, r)
       | DebugBreak _ -> e
       |> f
   
  
positive.code:             | [] -> lambdaBody
              | prevExprs -> Sequential(prevExprs@[lambdaBody], range)
          | e -> e
      transformExprTree optimizeExpr' expr
  
  let rec optimizeDeclaration (com: ICompiler) = function
      | EntityDeclaration(e, isPublic, privName, decls, r) ->
  
negative.code:             | true, replacement -> replacement
              | false, _ -> e
          | e -> e
      visit replaceVars' bodyExpr
  
  let (|RestAndTail|_|) (xs: _ list) =
      match List.rev xs with
  