allow ignoring additional arguments
This commit is contained in:
parent
e97af52bd4
commit
bc74bc8af5
3 changed files with 8 additions and 2 deletions
|
@ -15,4 +15,4 @@
|
|||
nativeBuildInputs = [pkgs.dhall-nix];
|
||||
};
|
||||
in
|
||||
import "${drv}" (import ./runtime.nix)
|
||||
import "${drv}" (import ./runtime.nix pkgs.lib)
|
||||
|
|
|
@ -5,6 +5,7 @@ let Set = ./Set/Type.dhall
|
|||
in { equal : Any → Any → Bool
|
||||
, fix : ∀(t : Type) → (t → t) → t
|
||||
, `fix'` : (Set → Set) → Set
|
||||
, ignoreOtherArgs : ∀(A: Type) → ∀(B: Type) → (A → B) → A → B
|
||||
, mergeAttrs : Set → Set → Set
|
||||
, toAny : ∀(t : Type) → ∀(v : t) → Any
|
||||
, toTypeUnchecked : ∀(t : Type) → ∀(v : Any) → t
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
{
|
||||
lib: {
|
||||
primops = {
|
||||
equal = a: b: a == b;
|
||||
fix = _: f: let x = f x; in x;
|
||||
fix' = f: let x = f x // { __unfix__ = f; }; in x;
|
||||
ignoreOtherArgs = _: _: f: let
|
||||
args = lib.trivial.functionArgs f;
|
||||
filterFunction = k: _: builtins.hasAttrs k set;
|
||||
filteredFunction = s: f (lib.attrsets.filterAttrs filterFunction s);
|
||||
in lib.trivial.setFunctionArgs filteredFunction args;
|
||||
mergeAttrs = a: b: a // b;
|
||||
toAny = _: v: v;
|
||||
toTypeUnchecked = _: v: v;
|
||||
|
|
Loading…
Reference in a new issue