improve functor tracking

This commit is contained in:
Johannes Kirschbauer 2024-01-05 11:37:51 +01:00 committed by Johannes Kirschbauer
parent 50e35a47eb
commit 9283bc08e6
2 changed files with 8 additions and 7 deletions

View File

@ -1,10 +1,7 @@
{ {
# import (builtins.fetchTree { #
# repo = "nixpkgs"; # All these arguments can be overriden in production build
# ref = "migrate-doc-comments"; #
# owner = "hsjobeki";
# type = "github";
# }) {},
nixpkgs ? (builtins.fetchTree { nixpkgs ? (builtins.fetchTree {
repo = "nixpkgs"; repo = "nixpkgs";
ref = "master"; ref = "master";

View File

@ -4,6 +4,7 @@ let
dropBack = l: lib.reverseList (lib.drop 1 (lib.reverseList l)); dropBack = l: lib.reverseList (lib.drop 1 (lib.reverseList l));
unwrapFunctor = f: f.__functor f;
/* * /* *
# Returns # Returns
@ -23,7 +24,10 @@ let
let let
lambda = lambda =
if lib.isFunction parent.${name} then if lib.isFunction parent.${name} then
builtins.lambdaMeta parent.${name} if parent.${name} ? __functor then
builtins.lambdaMeta (unwrapFunctor parent.${name})
else
builtins.lambdaMeta parent.${name}
else else
null; null;
attr = { position = builtins.unsafeGetAttrPos name parent; }; attr = { position = builtins.unsafeGetAttrPos name parent; };