yi-language-0.19.2: Collection of language-related Yi libraries.

Safe Haskell | None
Language | Haskell2010

Yi.Region

Description

This module defines the Region ADT

Synopsis

- 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

data Region Source #

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

#### Instances

Instances details

Binary Region Source # |
Instance details Defined in Yi.Region Methods put :: Region -> Put Source # get :: Get Region Source # putList :: [Region] -> Put Source #
Generic Region Source # |

Instance details

Defined in Yi.Region

Associated Types

type Rep Region |

Instance details

Defined in Yi.Region

type Rep Region = D1 ('MetaData "Region" "Yi.Region" "yi-language-0.19.2-9aqnsb1TqRMA1LJA09MZJx" 'False) (C1 ('MetaCons "Region" 'PrefixI 'True) (S1 ('MetaSel ('Just "regionDirection") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Direction) :*: (S1 ('MetaSel ('Just "regionStart") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point) :*: S1 ('MetaSel ('Just "regionEnd") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point))))

Methods

from :: Region -> Rep Region x Source #

to :: Rep Region x -> Region Source #

Show Region Source # |
Instance details Defined in Yi.Region Methods showsPrec :: Int -> Region -> ShowS Source # show :: Region -> String Source # showList :: [Region] -> ShowS Source #
type Rep Region Source # |

Instance details

Defined in Yi.Region

type Rep Region = D1 ('MetaData "Region" "Yi.Region" "yi-language-0.19.2-9aqnsb1TqRMA1LJA09MZJx" 'False) (C1 ('MetaCons "Region" 'PrefixI 'True) (S1 ('MetaSel ('Just "regionDirection") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Direction) :*: (S1 ('MetaSel ('Just "regionStart") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point) :*: S1 ('MetaSel ('Just "regionEnd") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point))))

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

mkRegion' :: Direction -> Point -> Point -> Region Source #

mkSizeRegion :: Point -> Size -> Region Source #

regionStart :: Region -> Point Source #

regionEnd :: Region -> Point Source #

regionSize :: Region -> Size Source #

regionDirection :: Region -> Direction Source #

inRegion :: Point -> Region -> Bool Source #

True if the given point is inside the given region.

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)

fmapRegion :: (Point -> Point) -> Region -> Region Source #

intersectRegion :: Region -> Region -> Region Source #

Take the intersection of two regions

unionRegion :: Region -> Region -> Region Source #

Take the union of two regions (including what is between them)

regionFirst :: Region -> Point Source #

regionLast :: Region -> Point Source #

regionsOverlap :: Bool -> Region -> Region -> Bool Source #