anchor.diff:        docPath = path: elemType.docPath (path + ".<name>");
         inherit (elemType) hasOptions delayOnGlobalEval;
       };
  +
  +    # List or attribute set of ...
  +    loaOf = elemType:
  +      let
  +        convertIfList = defIdx: def:
  +          if isList def then
  +            listToAttrs (
  +              flip imap def (elemIdx: elem:
  +                nameValuePair "unnamed-${toString defIdx}.${toString elemIdx}" elem))
  +          else
  +            def;
  +        listOnly = listOf elemType;
  +        attrOnly = attrsOf elemType;
  +
  +      in mkOptionType {
  +        name = "list or attribute set of ${elemType.name}s";
  +        check = x:
  +          if isList x       then listOnly.check x
  +          else if isAttrs x then attrOnly.check x
  +          else lib.traceValIfNot (x: false) x;
  +        ## The merge function returns an attribute set
  +        merge = defs:
  +          attrOnly.merge (imap convertIfList defs);
  +        iter = f: path: def:
  +          if isList def       then listOnly.iter f path def
  +          else if isAttrs def then attrOnly.iter f path def
  +          else throw "Unexpected value";
  +        fold = op: nul: def:
  +          if isList def       then listOnly.fold op nul def
  +          else if isAttrs def then attrOnly.fold op nul def
  +          else throw "Unexpected value";
  +
  +        docPath = path: elemType.docPath (path + ".<name?>");
  +        inherit (elemType) hasOptions delayOnGlobalEval;
  +      }
  +    ;
  +
   
       uniq = elemType: mkOptionType {
         inherit (elemType) name check iter fold docPath hasOptions;
  
positive.code: 
      attrsOf = elemType: mkOptionType {
        name = "attribute set of ${elemType.name}s";
        check = x: lib.traceValIfNot builtins.isAttrs x
          && fold (e: v: v && elemType.check e) true (lib.attrValues x);
        merge = lib.zip (name: elemType.merge);
        iter = f: path: set: lib.mapAttrs (name: elemType.iter f (path + "." + name)) set;
  
negative.code:     _type = typeName;
    };
  
  
    # name (name of the type)
    # check (boolean function)
    # merge (default merge function)
  