-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A generic boundingbox for an arbitrary vector -- @package boundingboxes @version 0.2.3 -- | The type and accessors for bounding boxes module Data.BoundingBox -- | The type of bounding box for arbitrary vector f. The -- functions for this type assume that f is a "zipping" -- Applicative. data Box f a Box :: (f a) -> (f a) -> Box f a -- | check whether the point is in the box. isInside :: (Applicative f, Foldable f, Ord a) => f a -> Box f a -> Bool -- | Extend each side. inflate :: (Functor f, Num a) => a -> Box f a -> Box f a -- | Returns True if the bounding box is valid. isCanonical :: (Applicative f, Foldable f, Ord a) => Box f a -> Bool -- | Calculate an union between two boundingboxes. union :: (Applicative f, Ord a) => Box f a -> Box f a -> Box f a -- | Calculate an intersect between two boundingboxes. intersect :: (Applicative f, Ord a) => Box f a -> Box f a -> Box f a -- | Enumerate the corners. corners :: (Applicative f, Traversable f) => Box f a -> [f a] sizePos :: (Applicative f, Num a) => f a -> Iso' (Box f a) (f a, f a) -- | The accessor for the position on the given reference. Usually the -- reference point position :: (Applicative f, Num a) => f a -> Lens' (Box f a) (f a) -- | The accessor for the size. A given reference point will be a center of -- resizing. size :: (Applicative f, Num a) => f a -> Lens' (Box f a) (f a) instance Show (f a) => Show (Box f a) instance Eq (f a) => Eq (Box f a) instance Ord (f a) => Ord (Box f a) instance Functor f => Functor (Box f) instance Foldable f => Foldable (Box f) instance Traversable f => Traversable (Box f) instance Read (f a) => Read (Box f a) instance Monad f => Monad (Box f) instance Applicative f => Applicative (Box f)