packages feed

papa-0.7.0: src/Papa/Base/Data/Foldable1.hs

{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -Wall #-}

-- | The largest and smallest elements of a non-empty structure.
--
-- These are "Data.Foldable1"'s: total, because a 'Data.Foldable1.Foldable1'
-- is never empty, so they need no 'Data.Maybe.Maybe'. "Data.Foldable"'s
-- @maximum@, @minimum@, @maximumBy@ and @minimumBy@, which throw for an empty
-- structure, are not exported. For a structure that may be empty (a list),
-- use 'Control.Lens.maximumOf' 'Control.Lens.folded', or make it a
-- 'Data.List.NonEmpty.NonEmpty' first with 'Data.List.NonEmpty.nonEmpty'.
--
-- @since 0.7.0
module Papa.Base.Data.Foldable1 (
  module P,
) where

import Data.Foldable1 as P (
  Foldable1 (toNonEmpty),
  maximum,
  maximumBy,
  minimum,
  minimumBy,
 )