semantic-source-0.1.0.2: Types and functionality for working with source code
Safe HaskellSafe-Inferred
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
Semigroup Range Source # 
Instance details

Defined in Source.Range

Methods

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

sconcat :: NonEmpty Range -> Range

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

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

Show Range Source # 
Instance details

Defined in Source.Range

Methods

showsPrec :: Int -> Range -> ShowS

show :: Range -> String

showList :: [Range] -> ShowS

NFData Range Source # 
Instance details

Defined in Source.Range

Methods

rnf :: Range -> ()

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

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

ToJSON Range Source # 
Instance details

Defined in Source.Range

Methods

toJSON :: Range -> Value

toEncoding :: Range -> Encoding

toJSONList :: [Range] -> Value

toEncodingList :: [Range] -> Encoding

type Rep Range Source # 
Instance details

Defined in Source.Range

type Rep Range = D1 ('MetaData "Range" "Source.Range" "semantic-source-0.1.0.2-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

start_ :: Lens' Range Int Source #

end_ :: Lens' Range Int Source #