Skip to content

Angle Brackets Syntax

Den provides a __findFile implementation that resolves <aspect/path> expressions into deep aspect lookups. This is syntactic sugar for accessing nested aspects and provides.

Set __findFile via module args:

{ den, ... }: {
_module.args.__findFile = den.lib.__findFile;
}

In any file where you want to use the angle-brackets syntax, add __findFile to the arguments attrset to bring it into that module’s lexical scope.

{ den, __findFile, ... }: {
...
}

The <name> expression resolves through these paths in order:

  1. <den.x.y> — resolves to config.den.x.y
  2. <aspect> — resolves to config.den.aspects.aspect (if aspect exists in den.aspects)
  3. <aspect/sub> — resolves to config.den.aspects.aspect.provides.sub
  4. <namespace> — resolves to config.den.ful.namespace (if it is a denful)

The / separator is translated to .provides. in the lookup path.

# Without angle brackets
den.aspects.laptop.includes = [
den.aspects.tools.provides.editors
den.aspects.alice.provides.work-vpn
den.provides.primary-user
];
# With angle brackets
den.aspects.laptop.includes = [
<tools/editors>
<alice/work-vpn>
<den.provides.primary-user>
];

Angle brackets are optional syntactic sugar. They are useful when:

  • You have deeply nested provides and want shorter references.
  • You are working with namespaces and want concise cross-references.

They are functionally identical to direct attribute access. The choice is a matter of style.

Contribute Community Sponsor