hgeometry-0.12.0.1: Geometric Algorithms, Data structures, and Data types.
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

Data.Geometry.Box.Sides

Description

 
Synopsis

Documentation

data Sides a Source #

The four sides of a rectangle

Constructors

Sides !a !a !a !a 

Instances

Instances details
Functor Sides Source # 
Instance details

Defined in Data.Geometry.Box.Sides

Methods

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

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

Applicative Sides Source # 
Instance details

Defined in Data.Geometry.Box.Sides

Methods

pure :: a -> Sides a #

(<*>) :: Sides (a -> b) -> Sides a -> Sides b #

liftA2 :: (a -> b -> c) -> Sides a -> Sides b -> Sides c #

(*>) :: Sides a -> Sides b -> Sides b #

(<*) :: Sides a -> Sides b -> Sides a #

Foldable Sides Source # 
Instance details

Defined in Data.Geometry.Box.Sides

Methods

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

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

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

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

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

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

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

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

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

toList :: Sides a -> [a] #

null :: Sides a -> Bool #

length :: Sides a -> Int #

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

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

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

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

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

Traversable Sides Source # 
Instance details

Defined in Data.Geometry.Box.Sides

Methods

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

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

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

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

Traversable1 Sides Source # 
Instance details

Defined in Data.Geometry.Box.Sides

Methods

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

sequence1 :: Apply f => Sides (f b) -> f (Sides b) #

Foldable1 Sides Source # 
Instance details

Defined in Data.Geometry.Box.Sides

Methods

fold1 :: Semigroup m => Sides m -> m #

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

toNonEmpty :: Sides a -> NonEmpty a #

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

Defined in Data.Geometry.Box.Sides

Methods

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

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

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

Defined in Data.Geometry.Box.Sides

Methods

compare :: Sides a -> Sides a -> Ordering #

(<) :: Sides a -> Sides a -> Bool #

(<=) :: Sides a -> Sides a -> Bool #

(>) :: Sides a -> Sides a -> Bool #

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

max :: Sides a -> Sides a -> Sides a #

min :: Sides a -> Sides a -> Sides a #

Read a => Read (Sides a) Source # 
Instance details

Defined in Data.Geometry.Box.Sides

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

Defined in Data.Geometry.Box.Sides

Methods

showsPrec :: Int -> Sides a -> ShowS #

show :: Sides a -> String #

showList :: [Sides a] -> ShowS #

Generic (Sides a) Source # 
Instance details

Defined in Data.Geometry.Box.Sides

Associated Types

type Rep (Sides a) :: Type -> Type #

Methods

from :: Sides a -> Rep (Sides a) x #

to :: Rep (Sides a) x -> Sides a #

Semigroup a => Semigroup (Sides a) Source # 
Instance details

Defined in Data.Geometry.Box.Sides

Methods

(<>) :: Sides a -> Sides a -> Sides a #

sconcat :: NonEmpty (Sides a) -> Sides a #

stimes :: Integral b => b -> Sides a -> Sides a #

Monoid a => Monoid (Sides a) Source # 
Instance details

Defined in Data.Geometry.Box.Sides

Methods

mempty :: Sides a #

mappend :: Sides a -> Sides a -> Sides a #

mconcat :: [Sides a] -> Sides a #

Ixed (Sides a) Source # 
Instance details

Defined in Data.Geometry.Box.Sides

Methods

ix :: Index (Sides a) -> Traversal' (Sides a) (IxValue (Sides a)) #

type Rep (Sides a) Source # 
Instance details

Defined in Data.Geometry.Box.Sides

type Rep (Sides a) = D1 ('MetaData "Sides" "Data.Geometry.Box.Sides" "hgeometry-0.12.0.1-744QXwUb5uS54emseMX1Co" 'False) (C1 ('MetaCons "Sides" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_north") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Just "_east") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a)) :*: (S1 ('MetaSel ('Just "_south") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Just "_west") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a))))
type Index (Sides a) Source # 
Instance details

Defined in Data.Geometry.Box.Sides

type IxValue (Sides a) Source # 
Instance details

Defined in Data.Geometry.Box.Sides

type IxValue (Sides a) = a

north :: forall a. Lens' (Sides a) a Source #

east :: forall a. Lens' (Sides a) a Source #

south :: forall a. Lens' (Sides a) a Source #

west :: forall a. Lens' (Sides a) a Source #

topSide :: Num r => Rectangle p r -> LineSegment 2 p r Source #

bottomSide :: Num r => Rectangle p r -> LineSegment 2 p r Source #

Oriented from *left to right*

leftSide :: Num r => Rectangle p r -> LineSegment 2 p r Source #

rightSide :: Num r => Rectangle p r -> LineSegment 2 p r Source #

The right side, oriented from *bottom* to top

sides :: Num r => Rectangle p r -> Sides (LineSegment 2 p r) Source #

The sides of the rectangle, in order (Top, Right, Bottom, Left). The sides themselves are also oriented in clockwise order. If, you want them in the same order as the functions topSide, bottomSide, leftSide, and rightSide, use sides` instead.

sides' :: Num r => Rectangle p r -> Sides (LineSegment 2 p r) Source #

The sides of the rectangle. The order of the segments is (Top, Right, Bottom, Left). Note that the segments themselves, are oriented as described by the functions topSide, bottomSide, leftSide, rightSide (basically: from left to right, and from bottom to top). If you want the segments oriented along the boundary of the rectangle, use the sides function instead.

sideDirections :: Sides CardinalDirection Source #

Constructs a Sides value that indicates the appropriate direction.