hgeometry-combinatorial
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageGHC2021

HGeometry.Small.TwoOrThree

Description

A type expressing that some value may have two or three values

Synopsis

Documentation

newtype TwoOrThree a Source #

Either two or three elements

Constructors

TwoOrThree (Either (Two a) (Three a)) 

Instances

Instances details
Foldable1 TwoOrThree Source # 
Instance details

Defined in HGeometry.Small.TwoOrThree

Methods

fold1 :: Semigroup m => TwoOrThree m -> m Source #

foldMap1 :: Semigroup m => (a -> m) -> TwoOrThree a -> m Source #

foldMap1' :: Semigroup m => (a -> m) -> TwoOrThree a -> m Source #

toNonEmpty :: TwoOrThree a -> NonEmpty a Source #

maximum :: Ord a => TwoOrThree a -> a Source #

minimum :: Ord a => TwoOrThree a -> a Source #

head :: TwoOrThree a -> a Source #

last :: TwoOrThree a -> a Source #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> TwoOrThree a -> b Source #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> TwoOrThree a -> b Source #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> TwoOrThree a -> b Source #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> TwoOrThree a -> b Source #

Functor TwoOrThree Source # 
Instance details

Defined in HGeometry.Small.TwoOrThree

Methods

fmap :: (a -> b) -> TwoOrThree a -> TwoOrThree b Source #

(<$) :: a -> TwoOrThree b -> TwoOrThree a Source #

Foldable TwoOrThree Source # 
Instance details

Defined in HGeometry.Small.TwoOrThree

Methods

fold :: Monoid m => TwoOrThree m -> m Source #

foldMap :: Monoid m => (a -> m) -> TwoOrThree a -> m Source #

foldMap' :: Monoid m => (a -> m) -> TwoOrThree a -> m Source #

foldr :: (a -> b -> b) -> b -> TwoOrThree a -> b Source #

foldr' :: (a -> b -> b) -> b -> TwoOrThree a -> b Source #

foldl :: (b -> a -> b) -> b -> TwoOrThree a -> b Source #

foldl' :: (b -> a -> b) -> b -> TwoOrThree a -> b Source #

foldr1 :: (a -> a -> a) -> TwoOrThree a -> a Source #

foldl1 :: (a -> a -> a) -> TwoOrThree a -> a Source #

toList :: TwoOrThree a -> [a] Source #

null :: TwoOrThree a -> Bool Source #

length :: TwoOrThree a -> Int Source #

elem :: Eq a => a -> TwoOrThree a -> Bool Source #

maximum :: Ord a => TwoOrThree a -> a Source #

minimum :: Ord a => TwoOrThree a -> a Source #

sum :: Num a => TwoOrThree a -> a Source #

product :: Num a => TwoOrThree a -> a Source #

Traversable TwoOrThree Source # 
Instance details

Defined in HGeometry.Small.TwoOrThree

Methods

traverse :: Applicative f => (a -> f b) -> TwoOrThree a -> f (TwoOrThree b) Source #

sequenceA :: Applicative f => TwoOrThree (f a) -> f (TwoOrThree a) Source #

mapM :: Monad m => (a -> m b) -> TwoOrThree a -> m (TwoOrThree b) Source #

sequence :: Monad m => TwoOrThree (m a) -> m (TwoOrThree a) Source #

Traversable1 TwoOrThree Source # 
Instance details

Defined in HGeometry.Small.TwoOrThree

Methods

traverse1 :: Apply f => (a -> f b) -> TwoOrThree a -> f (TwoOrThree b) Source #

sequence1 :: Apply f => TwoOrThree (f b) -> f (TwoOrThree b) Source #

Show a => Show (TwoOrThree a) Source # 
Instance details

Defined in HGeometry.Small.TwoOrThree

Eq a => Eq (TwoOrThree a) Source # 
Instance details

Defined in HGeometry.Small.TwoOrThree

Ord a => Ord (TwoOrThree a) Source # 
Instance details

Defined in HGeometry.Small.TwoOrThree

type Two = V2 Source #

  • Strict pair whose elements are of the same type.

Strict pair with both items the same

type Three = V3 Source #

Strict Triple with all items the same

pattern Two :: a -> a -> Two a Source #

Pattern synonym for strict pairs.

pattern Three :: a -> a -> a -> Three a Source #

Pattern synonym for strict triples.