anchor.diff:      if tg.Length <> 1 then raise EncoderException
       let ti = tg.[0]
       let dI = dD ti
  -    fun (x: Value) ->
  +    let empty = makeEmptySetOf t
  +    let ofSeq =
  +        FastInvoke.Compile(
  +            setModule.GetMethod("OfSeq").MakeGenericMethod(tg)
  +        ).Invoke1
  +    let seqCast =
  +        FastInvoke.Compile(
  +            seqModule.GetMethod("Cast").MakeGenericMethod(tg)
  +        ).Invoke1
  +    if i.FlattenCollections then
  +        function
  +        | Array vs -> ofSeq (seqCast (Seq.map dI vs))
  +        | _ -> raise DecoderException
  +    else fun (x: Value) ->
           let rec walk fields =
               seq {
                   for f in fields do
  
positive.code:                     | true, x -> Some x
                      | false, _ -> None
                  | _ -> None
              Pack = flatten
          }
  
  
negative.code:                     | _ -> ()
              }
          match x with
          | Null -> empty
          | Object [ "tree", Object tr ] ->
              ofSeq (seqCast (walk tr))
          | _ -> raise DecoderException
  
  let enumEncoder dE (i: FormatSettings) (t: System.Type) =
  