purescript-0.15.12: PureScript Programming Language Compiler

Safe Haskell | Safe-Inferred
Language | Haskell2010

Language.PureScript.AST.SourcePos

Description

Source position information

Synopsis

- type SourceAnn = (SourceSpan, [Comment])
- data SourcePos = SourcePos {
  - sourcePosLine :: Int
  - sourcePosColumn :: Int
  }
- displaySourcePos :: SourcePos -> Text
- displaySourcePosShort :: SourcePos -> Text
- data SourceSpan = SourceSpan {
  - spanName :: String
  - spanStart :: SourcePos
  - spanEnd :: SourcePos
  }
- displayStartEndPos :: SourceSpan -> Text
- displayStartEndPosShort :: SourceSpan -> Text
- displaySourceSpan :: FilePath -> SourceSpan -> Text
- internalModuleSourceSpan :: String -> SourceSpan
- nullSourceSpan :: SourceSpan
- nullSourceAnn :: SourceAnn
- pattern NullSourceSpan :: SourceSpan
- pattern NullSourceAnn :: SourceAnn
- nonEmptySpan :: SourceAnn -> Maybe SourceSpan
- widenSourceSpan :: SourceSpan -> SourceSpan -> SourceSpan
- widenSourceAnn :: SourceAnn -> SourceAnn -> SourceAnn

# Documentation

type SourceAnn = (SourceSpan, [Comment]) #

Source annotation - position information and comments.

data SourcePos #

Source position information

Constructors

SourcePos |
Fields sourcePosLine :: Int Line number sourcePosColumn :: Int Column number

#### Instances

Instances details

FromJSON SourcePos # |
Instance details Defined in Language.PureScript.AST.SourcePos Methods parseJSON :: Value -> Parser SourcePos # parseJSONList :: Value -> Parser [SourcePos] # omittedField :: Maybe SourcePos #
ToJSON SourcePos # |
Instance details Defined in Language.PureScript.AST.SourcePos Methods toJSON :: SourcePos -> Value # toEncoding :: SourcePos -> Encoding # toJSONList :: [SourcePos] -> Value # toEncodingList :: [SourcePos] -> Encoding # omitField :: SourcePos -> Bool #
Generic SourcePos # |
Instance details Defined in Language.PureScript.AST.SourcePos Associated Types type Rep SourcePos :: Type -> Type # Methods from :: SourcePos -> Rep SourcePos x # to :: Rep SourcePos x -> SourcePos #
Show SourcePos # |
Instance details Defined in Language.PureScript.AST.SourcePos Methods showsPrec :: Int -> SourcePos -> ShowS # show :: SourcePos -> String # showList :: [SourcePos] -> ShowS #
NFData SourcePos # |
Instance details Defined in Language.PureScript.AST.SourcePos Methods rnf :: SourcePos -> () #
Eq SourcePos # |
Instance details Defined in Language.PureScript.AST.SourcePos Methods (==) :: SourcePos -> SourcePos -> Bool # (/=) :: SourcePos -> SourcePos -> Bool #
Ord SourcePos # |
Instance details Defined in Language.PureScript.AST.SourcePos Methods compare :: SourcePos -> SourcePos -> Ordering # (<) :: SourcePos -> SourcePos -> Bool # (<=) :: SourcePos -> SourcePos -> Bool # (>) :: SourcePos -> SourcePos -> Bool # (>=) :: SourcePos -> SourcePos -> Bool # max :: SourcePos -> SourcePos -> SourcePos # min :: SourcePos -> SourcePos -> SourcePos #
Serialise SourcePos # |
Instance details Defined in Language.PureScript.AST.SourcePos Methods encode :: SourcePos -> Encoding # decode :: Decoder s SourcePos # encodeList :: [SourcePos] -> Encoding # decodeList :: Decoder s [SourcePos] #
type Rep SourcePos # |
Instance details Defined in Language.PureScript.AST.SourcePos type Rep SourcePos = D1 ('MetaData "SourcePos" "Language.PureScript.AST.SourcePos" "purescript-0.15.12-5l1zT9m1jq0GgrLEUvYibC" 'False) (C1 ('MetaCons "SourcePos" 'PrefixI 'True) (S1 ('MetaSel ('Just "sourcePosLine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "sourcePosColumn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

displaySourcePos :: SourcePos -> Text #

displaySourcePosShort :: SourcePos -> Text #

data SourceSpan #

Constructors

SourceSpan |
Fields spanName :: String Source name spanStart :: SourcePos Start of the span spanEnd :: SourcePos End of the span

#### Instances

Instances details

FromJSON SourceSpan # |
Instance details Defined in Language.PureScript.AST.SourcePos Methods parseJSON :: Value -> Parser SourceSpan # parseJSONList :: Value -> Parser [SourceSpan] # omittedField :: Maybe SourceSpan #
ToJSON SourceSpan # |
Instance details Defined in Language.PureScript.AST.SourcePos Methods toJSON :: SourceSpan -> Value # toEncoding :: SourceSpan -> Encoding # toJSONList :: [SourceSpan] -> Value # toEncodingList :: [SourceSpan] -> Encoding # omitField :: SourceSpan -> Bool #
Generic SourceSpan # |
Instance details Defined in Language.PureScript.AST.SourcePos Associated Types type Rep SourceSpan :: Type -> Type # Methods from :: SourceSpan -> Rep SourceSpan x # to :: Rep SourceSpan x -> SourceSpan #
Show SourceSpan # |
Instance details Defined in Language.PureScript.AST.SourcePos Methods showsPrec :: Int -> SourceSpan -> ShowS # show :: SourceSpan -> String # showList :: [SourceSpan] -> ShowS #
NFData SourceSpan # |
Instance details Defined in Language.PureScript.AST.SourcePos Methods rnf :: SourceSpan -> () #
Eq SourceSpan # |
Instance details Defined in Language.PureScript.AST.SourcePos Methods (==) :: SourceSpan -> SourceSpan -> Bool # (/=) :: SourceSpan -> SourceSpan -> Bool #
Ord SourceSpan # |
Instance details Defined in Language.PureScript.AST.SourcePos Methods compare :: SourceSpan -> SourceSpan -> Ordering # (<) :: SourceSpan -> SourceSpan -> Bool # (<=) :: SourceSpan -> SourceSpan -> Bool # (>) :: SourceSpan -> SourceSpan -> Bool # (>=) :: SourceSpan -> SourceSpan -> Bool # max :: SourceSpan -> SourceSpan -> SourceSpan # min :: SourceSpan -> SourceSpan -> SourceSpan #
Serialise SourceSpan # |
Instance details Defined in Language.PureScript.AST.SourcePos Methods encode :: SourceSpan -> Encoding # decode :: Decoder s SourceSpan # encodeList :: [SourceSpan] -> Encoding # decodeList :: Decoder s [SourceSpan] #
FromJSON (Constraint SourceAnn) # |
Instance details Defined in Language.PureScript.Types Methods parseJSON :: Value -> Parser (Constraint SourceAnn) # parseJSONList :: Value -> Parser [Constraint SourceAnn] # omittedField :: Maybe (Constraint SourceAnn) #
FromJSON (Type SourceAnn) # |
Instance details Defined in Language.PureScript.Types Methods parseJSON :: Value -> Parser (Type SourceAnn) # parseJSONList :: Value -> Parser [Type SourceAnn] # omittedField :: Maybe (Type SourceAnn) #
type Rep SourceSpan # |
Instance details Defined in Language.PureScript.AST.SourcePos type Rep SourceSpan = D1 ('MetaData "SourceSpan" "Language.PureScript.AST.SourcePos" "purescript-0.15.12-5l1zT9m1jq0GgrLEUvYibC" 'False) (C1 ('MetaCons "SourceSpan" 'PrefixI 'True) (S1 ('MetaSel ('Just "spanName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "spanStart") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourcePos) :*: S1 ('MetaSel ('Just "spanEnd") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourcePos))))

displayStartEndPos :: SourceSpan -> Text #

displayStartEndPosShort :: SourceSpan -> Text #

displaySourceSpan :: FilePath -> SourceSpan -> Text #

internalModuleSourceSpan :: String -> SourceSpan #

nullSourceSpan :: SourceSpan #

nullSourceAnn :: SourceAnn #

pattern NullSourceSpan :: SourceSpan #

pattern NullSourceAnn :: SourceAnn #

nonEmptySpan :: SourceAnn -> Maybe SourceSpan #

widenSourceSpan :: SourceSpan -> SourceSpan -> SourceSpan #

widenSourceAnn :: SourceAnn -> SourceAnn -> SourceAnn #