dhall-nix-lib/Optional/unzip.dhall

12 lines
377 B
Text

λ(nix : ../NixPrelude.dhall) →
let fold = ./fold.dhall nix
in λ(a : Type) →
λ(b : Type) →
λ(xs : Optional { _1 : a, _2 : b }) →
fold
{ _1 : a, _2 : b }
xs
{ _1 : Optional a, _2 : Optional b }
(λ(v : { _1 : a, _2 : b }) → { _1 = Some v._1, _2 = Some v._2 })
{ _1 = None a, _2 = None b }