dhall-nix-lib/Integer/listMax.dhall

15 lines
379 B
Text

λ(nix : ../NixPrelude.dhall) →
let max = ./max.dhall
let Optional/map = ../Optional/map.dhall nix
let listMax
: List Integer → Optional Integer
= λ(xs : List Integer) →
Optional/map
Integer
Integer
(λ(n : Integer) → List/fold Integer xs Integer max n)
(List/head Integer xs)
in listMax