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 #

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

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

toNonEmpty :: TwoOrThree a -> NonEmpty a #

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

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

head :: TwoOrThree a -> a #

last :: TwoOrThree a -> a #

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

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

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

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

Functor TwoOrThree Source # 
Instance details

Defined in HGeometry.Small.TwoOrThree

Methods

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

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

Foldable TwoOrThree Source # 
Instance details

Defined in HGeometry.Small.TwoOrThree

Methods

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

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

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

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

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

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

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

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

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

toList :: TwoOrThree a -> [a] #

null :: TwoOrThree a -> Bool #

length :: TwoOrThree a -> Int #

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

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

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

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

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

Traversable TwoOrThree Source # 
Instance details

Defined in HGeometry.Small.TwoOrThree

Methods

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

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

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

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

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

Methods

(==) :: TwoOrThree a -> TwoOrThree a -> Bool #

(/=) :: TwoOrThree a -> TwoOrThree a -> Bool #

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.