anchor.diff:  
         else
           replacement
  +
  +    let private memoize f =
  +      let cache = ref null
  +      fun () ->
  +        if cache.Value <> null then cache.Value
  +        else
  +          let value = f()
  +          cache := value
  +          value
   
       ///
       let private replace (_:FO) (this:CO) (search:BV) (replace:BV) =
  
positive.code:     let private replaceTokens =
        new Regex(@"[^$]+|\$\$|\$&|\$`|\$'|\$\d\d|\$\d|\$", RegexOptions.Compiled)
  
      let private evaluateReplacement (matched:string) (before:string) (after:string) (replacement:string) (groups:GroupCollection) =
        if replacement.Contains("$") then
  
          let tokens : seq<Capture> = replaceTokens.Matches replacement |> Seq.cast
  
negative.code:             let before = value.Substring(0, index)
              let after = value.Substring(index + search.Length)
              let replace = replace |> TC.ToString
              let replace = evaluateReplacement search (fun () -> before) (fun () -> after) replace null
              before + replace + after
  
          else
  