docs: function calculateFunction() {
    var args = mlutil.asArray.apply(null, arguments);
    if (args.length < 1) {
      throw new Error('calculate function without module name');
    }
  
    var moduleName = args[0];
  
    var rootname = mlutil.rootname(moduleName);
    if (rootname === null) {
      throw new Error('library must have an extension of .xqy');
    }
  
    return {
        'start-facet': {
          apply: 'start-facet',
          ns:    'http://marklogic.com/query/custom/'+rootname,
          at:    '/ext/marklogic/query/custom/'+moduleName
        },
        'finish-facet': {
          apply: 'finish-facet',
          ns:    'http://marklogic.com/query/custom/'+rootname,
          at:    '/ext/marklogic/query/custom/'+moduleName
        }
    };
  }