anchor.diff:  
   open System.Diagnostics
   open LanguagePrimitives
  +open ExtCore
  +open ExtCore.Collections
  +open ExtCore.Control
  +open ExtCore.Control.Collections
   open SpecializedCollections
   
   (*  Turn off warning about uppercase variable identifiers;
  
positive.code: // Add additional members to Regex.
  type Regex with
      //
      static member private IsNullableImpl regex cont =
          match regex with
          | Epsilon
          | Star _ ->
              cont true
          | Any
          | CharacterSet _ ->
              cont false
          | Negate regex ->
              Regex.IsNullableImpl regex (cont >> not)
          | Concat (a, b)
          | And (a, b) ->
              // IsNullable(a) && IsNullable(b)
              Regex.IsNullableImpl a <| fun a ->
                  if not a then false
                  else
                      Regex.IsNullableImpl b cont
          | Or (a, b) ->
              // IsNullable(a) || IsNullable(b)
              Regex.IsNullableImpl a <| fun a ->
                  if a then true
                  else
                      Regex.IsNullableImpl b cont
  
      /// Determines if a specified Regex is 'nullable',
      /// i.e., it accepts the empty string (epsilon).
  
negative.code: // Add more members to Regex
  type Regex with
      //
      static member private DerivativeClassesImpl regex =
          Cps.cont {
          match regex with
          | Epsilon ->
              return DerivativeClasses.Universe
          | Any ->
              return
                  { DerivativeClasses.Universe
                      with HasEmptySet = true; }
          | CharacterSet charSet ->
              return
                  { HasEmptySet = false;
                    Elements = charSet;
                    Negated = charSet; }
          | Negate r
          | Star r ->
              return! Regex.DerivativeClassesImpl r
          | Concat (r, s) ->
              if not <| Regex.IsNullable r then
                  return! Regex.DerivativeClassesImpl r
              else
                  let! ``C(r)`` = Regex.DerivativeClassesImpl r
                  let! ``C(s)`` = Regex.DerivativeClassesImpl s
                  return DerivativeClasses.Intersect (``C(r)``, ``C(s)``)
          | Or (r, s)
          | And (r, s) ->
              let! ``C(r)`` = Regex.DerivativeClassesImpl r
              let! ``C(s)`` = Regex.DerivativeClassesImpl s
              return DerivativeClasses.Intersect (``C(r)``, ``C(s)``)
          }
  
      /// Computes an approximate set of derivative classes for the specified Regex.
      static member DerivativeClasses (regex : Regex) =
  