fake.modules transposition for aspect-oriented Dendritic Nix. with cross-aspect dependencies. Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/
dendrix.oeiuwq.com/Dendritic.html
dendritic
nix
aspect
oriented
1# Transpose aspects.<aspect>.<class> to modules.<class>.<aspect>
2# Resolves aspect dependencies and applies transformations during transposition
3
4lib: aspects:
5let
6 # Import transpose utility with custom emit function for aspect resolution
7 transpose = import ./. { inherit lib emit; };
8
9 # Emit function: resolves each aspect for its target class
10 # Returns: [{ parent = class, child = aspect, value = resolved-module }]
11 emit = transposed: [
12 {
13 inherit (transposed) parent child;
14 value = aspects.${transposed.child}.resolve { class = transposed.parent; };
15 }
16 ];
17in
18{
19 # Exports: transposed.<class>.<aspect> = resolved-module
20 transposed = transpose aspects;
21}