From 9283bc08e6934be424ac9c97d81cc91c65cc843f Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Fri, 5 Jan 2024 11:37:51 +0100 Subject: [PATCH] improve functor tracking --- pasta/src/eval.nix | 9 +++------ pasta/src/tools.nix | 6 +++++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pasta/src/eval.nix b/pasta/src/eval.nix index 6ccf2f3..25f91c7 100644 --- a/pasta/src/eval.nix +++ b/pasta/src/eval.nix @@ -1,10 +1,7 @@ { - # import (builtins.fetchTree { - # repo = "nixpkgs"; - # ref = "migrate-doc-comments"; - # owner = "hsjobeki"; - # type = "github"; - # }) {}, + # + # All these arguments can be overriden in production build + # nixpkgs ? (builtins.fetchTree { repo = "nixpkgs"; ref = "master"; diff --git a/pasta/src/tools.nix b/pasta/src/tools.nix index d23d1da..b5e5774 100644 --- a/pasta/src/tools.nix +++ b/pasta/src/tools.nix @@ -4,6 +4,7 @@ let dropBack = l: lib.reverseList (lib.drop 1 (lib.reverseList l)); + unwrapFunctor = f: f.__functor f; /* * # Returns @@ -23,7 +24,10 @@ let let lambda = 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 null; attr = { position = builtins.unsafeGetAttrPos name parent; };