dhall-nix-lib/Optional/default.dhall

14 lines
314 B
Text
Raw Normal View History

2022-09-01 18:37:49 +00:00
λ(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