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

Safe HaskellNone
LanguageHaskell2010

Yi.Region

Description

This module defines the Region ADT

Synopsis

Documentation

data Region #

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
Show Region # 
Instance details

Defined in Yi.Region

Generic Region # 
Instance details

Defined in Yi.Region

Associated Types

type Rep Region :: Type -> Type #

Methods

from :: Region -> Rep Region x #

to :: Rep Region x -> Region #

Binary Region # 
Instance details

Defined in Yi.Region

Methods

put :: Region -> Put #

get :: Get Region #

putList :: [Region] -> Put #

type Rep Region # 
Instance details

Defined in Yi.Region

type Rep Region = D1 (MetaData "Region" "Yi.Region" "yi-language-0.18.0-9JxDcNN8ynUGWmH2c8GEZ2" 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 #

The empty region

mkRegion :: Point -> Point -> Region #

Construct a region from its bounds, emacs style: the right bound is excluded

inRegion :: Point -> Region -> Bool #

True if the given point is inside the given region.

nearRegion :: Point -> Region -> Bool #

True if the given point is inside the given region or at the end of it.

includedRegion :: Region -> Region -> Bool #

Returns if a region (1st arg) is included in another (2nd arg)

intersectRegion :: Region -> Region -> Region #

Take the intersection of two regions

unionRegion :: Region -> Region -> Region #

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