-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(errors): enhance throw info
- Loading branch information
Showing
6 changed files
with
91 additions
and
21 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
lib, | ||
yants, | ||
self, | ||
}: | ||
with yants; { | ||
a = struct "test" { name = string; }; | ||
b = either self.a (struct { age = int; }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,54 @@ | ||
flops.haumea.pops.default.setInit { | ||
{ | ||
flops, | ||
lib, | ||
root, | ||
projectDir, | ||
POP, | ||
}: | ||
load: | ||
let | ||
inherit | ||
(root.errors.requiredInputs load.inputs.inputs "omnibus.pops.configs" [ "std" ]) | ||
std | ||
; | ||
inherit (std.lib.dev) mkNixago; | ||
inherit (std.lib) cfg; | ||
|
||
applyRecursive = | ||
mkFunc: layoutData: | ||
lib.mapAttrsRecursiveCond (as: !(lib.isAttrs as && as ? data)) # Condition to check | ||
(n: v: mkFunc v) # Function to apply | ||
layoutData; | ||
|
||
# Function to process each layout | ||
processLayouts = | ||
data: cfgName: | ||
applyRecursive | ||
( | ||
layoutData: | ||
if (lib.hasAttr cfgName cfg) then | ||
mkNixago cfg.${cfgName} layoutData | ||
else | ||
throw "Unknown layout: ${cfgName}" | ||
) | ||
(data.layouts.default.${cfgName}); | ||
in | ||
((flops.haumea.pops.default.setInit { | ||
src = projectDir + "/units/configs"; | ||
inputs = root.lib.loaderInputs; | ||
} | ||
}).addLoadExtender | ||
{ inherit load; } | ||
).addExporters | ||
[ | ||
(POP.extendPop flops.haumea.pops.exporter ( | ||
self: _super: { | ||
exports = { | ||
stdNixago = lib.listToAttrs ( | ||
map (name: lib.nameValuePair name (processLayouts self name)) ( | ||
lib.attrNames self.layouts.default | ||
) | ||
); | ||
}; | ||
} | ||
)) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters