semantic-source-0.0.1.0: Types and functionality for working with source code
Safe HaskellNone
LanguageHaskell2010

Source.Range

Contents

Synopsis

Documentation

data Range Source #

A 0-indexed, half-open interval of integers, defined by start & end indices.

Constructors

Range 

Fields

Instances

Instances details
Eq Range Source # 
Instance details

Defined in Source.Range

Methods

(==) :: Range -> Range -> Bool #

(/=) :: Range -> Range -> Bool #

Ord Range Source # 
Instance details

Defined in Source.Range

Methods

compare :: Range -> Range -> Ordering #

(<) :: Range -> Range -> Bool #

(<=) :: Range -> Range -> Bool #

(>) :: Range -> Range -> Bool #

(>=) :: Range -> Range -> Bool #

max :: Range -> Range -> Range #

min :: Range -> Range -> Range #

Show Range Source # 
Instance details

Defined in Source.Range

Methods

showsPrec :: Int -> Range -> ShowS #

show :: Range -> String #

showList :: [Range] -> ShowS #

Generic Range Source # 
Instance details

Defined in Source.Range

Associated Types

type Rep Range :: Type -> Type #

Methods

from :: Range -> Rep Range x #

to :: Rep Range x -> Range #

Semigroup Range Source # 
Instance details

Defined in Source.Range

Methods

(<>) :: Range -> Range -> Range #

sconcat :: NonEmpty Range -> Range #

stimes :: Integral b => b -> Range -> Range #

NFData Range Source # 
Instance details

Defined in Source.Range

Methods

rnf :: Range -> () #

Hashable Range Source # 
Instance details

Defined in Source.Range

Methods

hashWithSalt :: Int -> Range -> Int

hash :: Range -> Int

Lower Range Source # 
Instance details

Defined in Source.Range

Methods

lowerBound :: Range

type Rep Range Source # 
Instance details

Defined in Source.Range

type Rep Range = D1 ('MetaData "Range" "Source.Range" "semantic-source-0.0.1.0-inplace" 'False) (C1 ('MetaCons "Range" 'PrefixI 'True) (S1 ('MetaSel ('Just "start") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "end") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Int)))

point :: Int -> Range Source #

Construct a Range with a given value for both its start and end indices.

rangeLength :: Range -> Int Source #

Return the length of the range.

Lenses

end_ :: Lens' Range Int Source #