Copyright | (c) OleksandrZhabenko 2020 |
---|---|
License | MIT |
Maintainer | olexandr543@yahoo.com |
Stability | Experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- minMax23 :: (Ord a, InsertLeft t a, Monoid (t a)) => t a -> Maybe ((a, a), (a, a, a))
- minMax32 :: (Ord a, InsertLeft t a, Monoid (t a)) => t a -> Maybe ((a, a, a), (a, a))
- minMax33 :: (Ord a, InsertLeft t a, Monoid (t a)) => t a -> Maybe ((a, a, a), (a, a, a))
Documentation
minMax23 :: (Ord a, InsertLeft t a, Monoid (t a)) => t a -> Maybe ((a, a), (a, a, a)) Source #
Given a finite structure with at least 5 elements returns a tuple with two minimum elements
and three maximum elements. If the structure has less elements, returns Nothing
.
Uses just three passes through the structure, so may be more efficient than some other approaches.
minMax32 :: (Ord a, InsertLeft t a, Monoid (t a)) => t a -> Maybe ((a, a, a), (a, a)) Source #
Given a finite structure with at least 5 elements returns a tuple with three minimum elements
and two maximum elements. If the structure has less elements, returns Nothing
.
Uses just three passes through the structure, so may be more efficient than some other approaches.
minMax33 :: (Ord a, InsertLeft t a, Monoid (t a)) => t a -> Maybe ((a, a, a), (a, a, a)) Source #
Given a finite structure with at least 6 elements returns a tuple with three minimum elements
and three maximum elements. If the structure has less elements, returns Nothing
.
Uses just three passes through the structure, so may be more efficient than some other approaches.