dhall-nix-lib/Number/listMax.dhall

17 lines
403 B
Text

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