pro-source-0.1.0.0: Utilities for tracking source locations
Copyright© 2019 James Alexander Feldman-Crough
LicenseMPL-2.0
Safe HaskellNone
LanguageHaskell2010

ProSource.Source

Description

 
Synopsis

Documentation

data Source Source #

Information about a source file.

The Show instance for ths class does not include the LineMap or Text fields, as those are rather noisy.

Constructors

Source 

Fields

  • sourceName :: String

    The reported file-name of the Source.

    When read from file handles, a non-filepath description such as "<stdin>" is typically chosen. This field doesn't have semantic meaning, and should only be used to enrich the output displayed to users.

  • sourceText :: Text

    The full source, as Text.

  • sourceLineMap :: LineMap

    A mapping of the start position of each line in the Source.

Instances

Instances details
Eq Source Source # 
Instance details

Defined in ProSource.Source

Methods

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

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

Show Source Source # 
Instance details

Defined in ProSource.Source

Generic Source Source # 
Instance details

Defined in ProSource.Source

Associated Types

type Rep Source :: Type -> Type #

Methods

from :: Source -> Rep Source x #

to :: Rep Source x -> Source #

NFData Source Source # 
Instance details

Defined in ProSource.Source

Methods

rnf :: Source -> () #

Hashable Source Source # 
Instance details

Defined in ProSource.Source

Methods

hashWithSalt :: Int -> Source -> Int #

hash :: Source -> Int #

Pretty Source Source # 
Instance details

Defined in ProSource.Source

Methods

pretty :: Source -> Doc ann #

prettyList :: [Source] -> Doc ann #

type Rep Source Source # 
Instance details

Defined in ProSource.Source

type Rep Source = D1 ('MetaData "Source" "ProSource.Source" "pro-source-0.1.0.0-Aka5hIIzvNFHIHVEFICznz" 'False) (C1 ('MetaCons "Source" 'PrefixI 'True) (S1 ('MetaSel ('Just "sourceName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String) :*: (S1 ('MetaSel ('Just "sourceText") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "sourceLineMap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 LineMap))))