Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module defines the Region ADT
- data Region
- emptyRegion :: Region
- regionIsEmpty :: Region -> Bool
- mkRegion :: Point -> Point -> Region
- mkRegion' :: Direction -> Point -> Point -> Region
- mkSizeRegion :: Point -> Size -> Region
- regionStart :: Region -> Point
- regionEnd :: Region -> Point
- regionSize :: Region -> Size
- regionDirection :: Region -> Direction
- inRegion :: Point -> Region -> Bool
- nearRegion :: Point -> Region -> Bool
- includedRegion :: Region -> Region -> Bool
- fmapRegion :: (Point -> Point) -> Region -> Region
- intersectRegion :: Region -> Region -> Region
- unionRegion :: Region -> Region -> Region
- regionFirst :: Region -> Point
- regionLast :: Region -> Point
- regionsOverlap :: Bool -> Region -> Region -> Bool
Documentation
The region data type. The region is semi open: it includes the start but not the end bound. This allows simpler region-manipulation algorithms. Invariant : regionStart r <= regionEnd r
emptyRegion :: Region Source #
The empty region
regionIsEmpty :: Region -> Bool Source #
mkRegion :: Point -> Point -> Region Source #
Construct a region from its bounds, emacs style: the right bound is excluded
regionStart :: Region -> Point Source #
regionSize :: Region -> Size Source #
regionDirection :: Region -> Direction Source #
nearRegion :: Point -> Region -> Bool Source #
True if the given point is inside the given region or at the end of it.
includedRegion :: Region -> Region -> Bool Source #
Returns if a region (1st arg) is included in another (2nd arg)
unionRegion :: Region -> Region -> Region Source #
Take the union of two regions (including what is between them)
regionFirst :: Region -> Point Source #
regionLast :: Region -> Point Source #