| Copyright | (c) OleksandrZhabenko 2020 |
|---|---|
| License | MIT |
| Maintainer | olexandr543@yahoo.com |
| Stability | Experimental |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Data.MinMax3Plus
Description
Synopsis
- minMax23 :: (Ord a, InsertLeft t a, Monoid (t a)) => t a -> ((a, a), (a, a, a))
- minMax23By :: (Ord a, InsertLeft t a, Monoid (t a)) => (a -> a -> Ordering) -> t a -> ((a, a), (a, a, a))
- minMax32 :: (Ord a, InsertLeft t a, Monoid (t a)) => t a -> ((a, a, a), (a, a))
- minMax32By :: (Ord a, InsertLeft t a, Monoid (t a)) => (a -> a -> Ordering) -> t a -> ((a, a, a), (a, a))
- minMax33 :: (Ord a, InsertLeft t a, Monoid (t a)) => t a -> ((a, a, a), (a, a, a))
- minMax33By :: (Ord a, InsertLeft t a, Monoid (t a)) => (a -> a -> Ordering) -> t a -> ((a, a, a), (a, a, a))
Documentation
minMax23 :: (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 three passes through the structure, so may be more efficient than some other approaches.
minMax23By :: (Ord a, InsertLeft t a, Monoid (t a)) => (a -> a -> Ordering) -> t a -> ((a, a), (a, a, a)) Source #
A variant of the minMax23 where you can specify your own comparison function.
minMax32 :: (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 three passes through the structure, so may be more efficient than some other approaches.
minMax32By :: (Ord a, InsertLeft t a, Monoid (t a)) => (a -> a -> Ordering) -> t a -> ((a, a, a), (a, a)) Source #
A variant of the minMax32 where you can specify your own comparison function.
minMax33 :: (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 three passes through the structure, so may be more efficient than some other approaches.
minMax33By :: (Ord a, InsertLeft t a, Monoid (t a)) => (a -> a -> Ordering) -> t a -> ((a, a, a), (a, a, a)) Source #
A variant of the minMax33 where you can specify your own comparison function.