anchor.diff:                      else Or (s', r')
                       |> cont
           
  +        | And (Any, r)
  +        | And (r, Any) ->
  +            Regex.CanonicalizeImpl r cont
           | And (Empty, _)
           | And (_, Empty) ->
               cont Regex.empty
  -        | And (Any, r)
  -        | And (r, Any) ->
  -            Regex.CanonicalizeImpl r cont
  +        | And (CharacterSet charSet1, CharacterSet charSet2) ->
  +            // 'And' is the conjunction (intersection) of two Regexes.
  +            let charSetIntersection = CharSet.intersect charSet1 charSet2
  +
  +            // Return the simplest Regex for the intersection set.
  +            CharacterSet charSetIntersection
  +            |> cont
           | And (r, And (s, t)) ->
               // Rewrite the expression so it's left-associative.
               let regex = And (And (r, s), t)
  
positive.code: [<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
  module FSharpLex.Regex
  
  open LanguagePrimitives
  open SpecializedCollections
  
  
negative.code:                     Concat (r', s')
                      |> cont
  
          | Or (Any, _)
          | Or (_, Any) ->
              cont Any
          | Or (Empty, r)
          | Or (r, Empty) ->
              Regex.CanonicalizeImpl r cont
          | Or (CharacterSet charSet1, CharacterSet charSet2) ->
              // 'Or' is the disjunction (union) of two Regexes.
              let charSetUnion = CharSet.union charSet1 charSet2
  
              // Return the simplest Regex for the union set.
              CharacterSet charSetUnion
              |> cont
  
          | Or (r, Or (s, t)) ->
              // Rewrite the expression so it's left-associative.
              let regex = Or (Or (r, s), t)
  