dhall-nix-lib/Optional/default.dhall
2022-09-01 19:37:49 +01:00

13 lines
314 B
Text

λ(nix : ../NixPrelude.dhall) →
let identity = ../Function/identity.dhall
let fold = ./fold.dhall nix
let default
: ∀(a : Type) → a → Optional a → a
= λ(a : Type) →
λ(default : a) →
λ(o : Optional a) →
fold a o a (identity a) default
in default