dhall-nix-lib/Function/setFunctionArgs.dhall

31 lines
957 B
Text

λ(nix : ../NixPrelude.dhall) →
let Any = ../Any/Type.dhall
let Map =
https://raw.githubusercontent.com/dhall-lang/dhall-lang/v22.0.0/Prelude/Map/Type.dhall
sha256:210c7a9eba71efbb0f7a66b3dcf8b9d3976ffc2bc0e907aadfb6aa29c333e8ed
let Set = ../Set/Type.dhall
let Any/toAny = ../Any/toAny.dhall nix
let Any/toTypeUnchecked = ../Any/toTypeUnchecked.dhall nix
let Set/toSet = ../Set/toSet.dhall nix
let setFunctionArgs
: ∀(A : Type) → ∀(B : Type) → (A → B) → Map Text Bool → A → B
= λ(A : Type) →
λ(B : Type) →
λ(f : A → B) →
λ(args : Map Text Bool) →
Any/toTypeUnchecked
(A → B)
( Any/toAny
{ __functor : Any → A → B, __functionArgs : Set }
{ __functor = λ(_ : Any) → f
, __functionArgs = Set/toSet Bool args
}
)
in setFunctionArgs