anchor.diff:          apply = lib.id;
         };
   
  -      mergeFromType = opt:
  +      functionsFromType = opt:
           if decl ? type && decl.type ? merge then
  -          opt // { merge = decl.type.merge; }
  +          opt
  +          // optionalAttrs (decl.type ? merge) { inherit (decl.type) merge; }
  +          // optionalAttrs (decl.type ? check) { inherit (decl.type) check; }
           else
             opt;
   
         addDeclaration = opt: opt // decl;
   
         ensureMergeInputType = opt:
  -        if decl ? type then
  +        if opt ? check then
             opt // {
               merge = list:
  -              if all decl.type.check list then
  +              if all opt.check list then
                   opt.merge list
                 else
                   throw "One of the definitions has a bad type.";
  
positive.code:                   opt.name
                    (opt.merge list);
                options =
                  let path = decl.type.docPath opt.name; in
                  (lib.fix
                    (fixableMergeFun (recurseInto path) (optionConfig []))
                  ).options;
  
negative.code:     in
        foldl (opt: f: f opt) init [
          # default settings
          functionsFromType
  
          # user settings
          addDeclaration
  