예제 #1
0
 public static Mapper <MetaValue> .ToRule CollectionsAreMappedToMetaArrays(Mapper <MetaValue> binder) => o =>
 {
     if (o is ICollection c)
     {
         var items = c.Cast <object>().Select(binder.Map).Where(ob => ob.IsT0).Select(x => x.Match(mv => mv, na => null)).ToArray();
         return((Mapper <MetaValue> .RuleOutput)(MetaValue) MetaArray.From(items));
     }
     return(new NA());
 };