23 lines
641 B
Text
23 lines
641 B
Text
|
λ(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 fix
|
||
|
: ∀(t : Type) → (t → t) → t
|
||
|
= λ(t : Type) →
|
||
|
Any/toTypeUnchecked ((t → t) → t) (nix.builtins.import fixFile)
|
||
|
|
||
|
let fixp
|
||
|
: ∀(t : Type) → (t → t) → t
|
||
|
= λ(t : Type) →
|
||
|
Any/toTypeUnchecked ((t → t) → t) (nix.builtins.import fixFilep)
|
||
|
|
||
|
in { fix, fixp }
|