subG-0.5.3.0: Some extension to the Foldable and Monoid classes.
Copyright(c) OleksandrZhabenko 2020
LicenseMIT
Maintainerolexandr543@yahoo.com
StabilityExperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.MinMax3Plus.Preconditions

Description

Functions to find both minimum and maximum elements of the Foldable structure of the Ordered elements. With the preconditions that the structure at least have enough elements (this is contrary to the functions from the module Data.MinMax not checked internally).

Synopsis

Documentation

minMax23C :: (Ord a, InsertLeft t a, Monoid (t a)) => t a -> ((a, a), (a, a, a)) Source #

Given a finite structure returns a tuple with two minimum elements and three maximum elements. Uses just two passes through the structure, so may be more efficient than some other approaches.

minMax23ByC :: (Ord a, InsertLeft t a, Monoid (t a)) => (a -> a -> Ordering) -> t a -> ((a, a), (a, a, a)) Source #

A variant of the minMax23C where you can specify your own comparison function.

minMax32C :: (Ord a, InsertLeft t a, Monoid (t a)) => t a -> ((a, a, a), (a, a)) Source #

Given a finite structure returns a tuple with three minimum elements and two maximum elements. Uses just two passes through the structure, so may be more efficient than some other approaches.

minMax32ByC :: (Ord a, InsertLeft t a, Monoid (t a)) => (a -> a -> Ordering) -> t a -> ((a, a, a), (a, a)) Source #

A variant of the minMax32C where you can specify your own comparison function.

minMax33C :: (Ord a, InsertLeft t a, Monoid (t a)) => t a -> ((a, a, a), (a, a, a)) Source #

Given a finite structure returns a tuple with three minimum elements and three maximum elements. Uses just two passes through the structure, so may be more efficient than some other approaches.

minMax33ByC :: (Ord a, InsertLeft t a, Monoid (t a)) => (a -> a -> Ordering) -> t a -> ((a, a, a), (a, a, a)) Source #

A variant of the minMax33C where you can specify your own comparison function.