dhall-nix-lib/Double/listMax.dhall

17 lines
529 B
Text

λ(nix : ../NixPrelude.dhall) →
let Optional/map =
https://raw.githubusercontent.com/dhall-lang/dhall-lang/v22.0.0/Prelude/Optional/map.dhall
sha256:501534192d988218d43261c299cc1d1e0b13d25df388937add784778ab0054fa
let max = ./max.dhall nix
let listMax
: List Double → Optional Double
= λ(xs : List Double) →
Optional/map
Double
Double
(λ(n : Double) → List/fold Double xs Double max n)
(List/head Double xs)
in listMax