14 lines
428 B
Text
14 lines
428 B
Text
--| Transform the value in an `Optional` into `Text`, defaulting `None` to `""`
|
|
λ(nix : ../NixPrelude.dhall) →
|
|
let Optional/map = ../Optional/map.dhall nix
|
|
|
|
let default = ./default.dhall nix
|
|
|
|
let defaultMap
|
|
: ∀(a : Type) → (a → Text) → Optional a → Text
|
|
= λ(a : Type) →
|
|
λ(f : a → Text) →
|
|
λ(o : Optional a) →
|
|
default (Optional/map a Text f o)
|
|
|
|
in defaultMap
|