anchor.diff:      let step expr =
           match expr with
           | Application (Lambda (None, args, body), xs) ->
  -            let rec binds args xs body =
  -                match args, xs with
  -                | a :: args, x :: xs -> Let (a, x, binds args xs body)
  -                | [], [] -> body
  -                | [], _ -> Application(body, xs)
  -                | _, [] -> Lambda(None, args, body)
  -            binds args xs body
  +            if List.length args = List.length xs then
  +                let bind key value body = Let (key, value, body)
  +                List.foldBack2 bind args xs body
  +            else expr
           | Application (Let (var, value, body), xs) ->
               Let (var, value, Application (body, xs))
           | Lambda (None, [x], Application (f, [Var y])) ->
               if x = y && isPure f then f else expr
           | Let (var, Let (v, vl, bd), body) ->
               Let (v, vl, Let (var, bd, body))
  -        | Let (var, value, Application (f, [Var v])) when v = var && isPure f ->
  -            Application(f, [value])
           | Let (var, value, body) when not var.IsMutable ->
               match value with
               | Constant _ | Global _ | Runtime ->
  
positive.code:                         else inlineLet expr var value body
                  else expr
              | _ ->
                  // do not recur on large expressions (since this is quadratic).
                  if size > 128 then expr else
                      match occurenceCount var body with
                      | 0 -> if isPure value then body else Sequential (value, body)
                      | 1 -> inlineLet expr var value body
                      | _ -> expr
          | Sequential (a, b) when isPure a ->
              b
          | _ ->
  
negative.code:     let bound = HashSet()
      let rec rem expr =
          match expr with
          | Lambda (Some this, args, body) ->
              bound.Add(this) |> ignore
              let bodyTr = Transform rem body
              if bound.Remove(this) then
                   Lambda (None, args, bodyTr)
              else
                   Lambda (Some this, args, bodyTr)
          | Var v ->
              bound.Remove(v) |> ignore
              expr
          | _ ->
              Transform rem expr
      rem expr
  
  /// Transforms local Let- or LetRecursive-bound curried lambda functions to
  