dhall-nix-lib/Any/selectOptional.dhall

11 lines
262 B
Text
Raw Normal View History

2022-08-31 13:18:49 +00:00
λ(nix : ../NixPrelude.dhall) →
let Any = ./Type.dhall
let Any/select = ./select.dhall nix
let Any/hasAttr = ./hasAttr.dhall nix
in λ(e : Any) →
λ(attr : Text) →
if Any/hasAttr e attr then Some (Any/select e attr) else None Any