remove imports

This commit is contained in:
Charlotte 🦝 Delenk 2022-09-09 09:07:20 +01:00
parent 850b53a4a1
commit e97af52bd4
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122
6 changed files with 18 additions and 35 deletions

View file

@ -1,8 +1 @@
λ(nix : ../NixPrelude.dhall) →
let Any = ./Type.dhall
let Any/toTypeUnchecked = ./toTypeUnchecked.dhall nix
let eqFile = nix.builtins.toFile "eq.nix" "a: b: a == b"
in Any/toTypeUnchecked (Any → Any → Bool) (nix.builtins.import eqFile)
λ(nix : ../NixPrelude.dhall) → nix.primops.equal

View file

@ -1,22 +1,12 @@
λ(nix : ../NixPrelude.dhall) →
let fixSrc = "f: let x = f x; in x"
let fixSrcp = "f: let x = f x // { __unfix__ = f; }; in x"
let fixFile = nix.builtins.toFile "fix.nix" fixSrc
let fixFilep = nix.builtins.toFile "fix.nix" fixSrcp
let Any/toTypeUnchecked = ../Any/toTypeUnchecked.dhall nix
let Set = ../Set/Type.dhall
let fix
: ∀(t : Type) → (t → t) → t
= λ(t : Type) →
Any/toTypeUnchecked ((t → t) → t) (nix.builtins.import fixFile)
= nix.primops.fix
let fixp
: ∀(t : Type) → (t → t) → t
= λ(t : Type) →
Any/toTypeUnchecked ((t → t) → t) (nix.builtins.import fixFilep)
: (Set → Set) → Set
= nix.primops.`fix'`
in { fix, fixp }

View file

@ -7,7 +7,7 @@
let Any/toTypeUnchecked = ../Any/toTypeUnchecked.dhall nix
let fixp = (./fix.dhall nix).fixp Set
let fixp = (./fix.dhall nix).fixp
let Set/toSet = ../Set/toSet.dhall nix

View file

@ -1,16 +1,6 @@
λ(nix : ../NixPrelude.dhall) →
let Set = ./Type.dhall
let Any/toTypeUnchecked = ../Any/toTypeUnchecked.dhall nix
let mergeAttrFile = "a: b: a // b"
let mergeAttrs =
Any/toTypeUnchecked
(Set → Set → Set)
( nix.builtins.import
(nix.builtins.toFile "mergeAttrs.nix" mergeAttrFile)
)
: Set → Set → Set
let mergeAttrs = nix.primops.mergeAttrs : Set → Set → Set
in mergeAttrs

View file

@ -1,5 +1,11 @@
let Any = ./Any/Type.dhall
in { toAny : ∀(t : Type) → ∀(v : t) → Any
let Set = ./Set/Type.dhall
in { equal : Any → Any → Bool
, fix : ∀(t : Type) → (t → t) → t
, `fix'` : (Set → Set) → Set
, mergeAttrs : Set → Set → Set
, toAny : ∀(t : Type) → ∀(v : t) → Any
, toTypeUnchecked : ∀(t : Type) → ∀(v : Any) → t
}

View file

@ -1,5 +1,9 @@
{
primops = {
equal = a: b: a == b;
fix = _: f: let x = f x; in x;
fix' = f: let x = f x // { __unfix__ = f; }; in x;
mergeAttrs = a: b: a // b;
toAny = _: v: v;
toTypeUnchecked = _: v: v;
};