dhall-nix-lib/NonEmpty/zip.dhall

20 lines
486 B
Text

λ(nix : ../NixPrelude.dhall) →
let NonEmpty = ./Type.dhall
let List/zip = ../List/zip.dhall nix
let zip
: ∀(a : Type) →
NonEmpty a →
∀(b : Type) →
NonEmpty b →
NonEmpty { _1 : a, _2 : b }
= λ(a : Type) →
λ(xs : NonEmpty a) →
λ(b : Type) →
λ(ys : NonEmpty b) →
{ head = { _1 = xs.head, _2 = ys.head }
, tail = List/zip a xs.tail b ys.tail
}
in zip