anchor.diff:      let rec private orImpl (regex1 : Regex) (regex2 : Regex) =
           cont {
           match regex1, regex2 with
  -        | CharacterSet charSet, regex
  -        | regex, CharacterSet charSet
  -            when CharSet.isEmpty charSet ->
  +        | Empty, regex
  +        | regex, Empty ->
               return regex
   
           | CharacterSet charSet1, CharacterSet charSet2 ->
               return
                   CharSet.union charSet1 charSet2
                   |> CharacterSet
  +
  +        // NOTE : These next two rewrite rules aren't specified in the original paper, but are useful for compacting the regex.
  +        | Star (CharacterSet charSet1), Star (CharacterSet charSet2) ->
  +            return
  +                CharSet.union charSet1 charSet2
  +                |> CharacterSet
  +                |> star
  +
  +        | Star (CharacterSet charSet1), Or (Star (CharacterSet charSet2), regex) ->
  +            let starUnion =
  +                CharSet.union charSet1 charSet2
  +                |> CharacterSet
  +                |> star
  +
  +            return! orImpl starUnion regex
   
           | Any, _
           | _, Any ->
  
positive.code:     [<CompiledName("CreateStar")>]
      let rec star (regex : Regex) : Regex =
          match regex with
          | Epsilon ->
              Epsilon
          | CharacterSet charSet
              when CharSet.isEmpty charSet ->
              Epsilon
          | Or (Epsilon, regex)
          | Or (regex, Epsilon)
  
negative.code:     let rec private andImpl (regex1 : Regex) (regex2 : Regex) =
          cont {
          match regex1, regex2 with
          | Empty, _
          | _, Empty ->
              return empty
  
          | CharacterSet charSet1, CharacterSet charSet2 ->
              let intersection = CharSet.intersect charSet1 charSet2
  
              // If the intersection of the two charsets is empty, this pattern
              // can never be matched, so return the Empty pattern.
              return
                  if CharSet.isEmpty intersection then
                      empty
                  else
                      CharacterSet intersection
  
  //        | Star (CharacterSet charSet1), Star (CharacterSet charSet2) ->
  //            return
  //                CharSet.intersect charSet1 charSet2
  //                |> CharacterSet
  //                |> Star
  
          | Any, regex
          | regex, Any ->
  