ghc-lib-parser-9.12.2.20250421: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Types.SourceFile

Synopsis

- data HscSource where
  - HsSrcFile
  - HsBootOrSig !HsBootOrSig
  - pattern HsBootFile :: HscSource
  - pattern HsigFile :: HscSource
- data HsBootOrSig
  - = HsBoot
  - | Hsig
- hscSourceToIsBoot :: HscSource -> IsBootInterface
- isHsBootOrSig :: HscSource -> Bool
- isHsBootFile :: HscSource -> Bool
- isHsigFile :: HscSource -> Bool
- hscSourceString :: HscSource -> String

# Documentation

data HscSource Source #

Constructors

HsSrcFile | .hs file
HsBootOrSig !HsBootOrSig | .hs-boot or .hsig file

Bundled Patterns

pattern HsBootFile :: HscSource |
pattern HsigFile :: HscSource |

#### Instances

Instances details

Show HscSource Source # |
Instance details Defined in GHC.Types.SourceFile Methods showsPrec :: Int -> HscSource -> ShowS Source # show :: HscSource -> String Source # showList :: [HscSource] -> ShowS Source #
Binary HscSource Source # |
Instance details Defined in GHC.Types.SourceFile Methods put_ :: WriteBinHandle -> HscSource -> IO () Source # put :: WriteBinHandle -> HscSource -> IO (Bin HscSource) Source # get :: ReadBinHandle -> IO HscSource Source #
Eq HscSource Source # |
Instance details Defined in GHC.Types.SourceFile Methods (==) :: HscSource -> HscSource -> Bool Source # (/=) :: HscSource -> HscSource -> Bool Source #
Ord HscSource Source # |

Instance details

Defined in GHC.Types.SourceFile

Methods

compare :: HscSource -> HscSource -> Ordering Source #

(<) :: HscSource -> HscSource -> Bool Source #

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

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

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

max :: HscSource -> HscSource -> HscSource Source #

min :: HscSource -> HscSource -> HscSource Source #

data HsBootOrSig Source #

Constructors

HsBoot | .hs-boot file
Hsig | .hsig file

#### Instances

Instances details

Show HsBootOrSig Source # |
Instance details Defined in GHC.Types.SourceFile Methods showsPrec :: Int -> HsBootOrSig -> ShowS Source # show :: HsBootOrSig -> String Source # showList :: [HsBootOrSig] -> ShowS Source #
Eq HsBootOrSig Source # |
Instance details Defined in GHC.Types.SourceFile Methods (==) :: HsBootOrSig -> HsBootOrSig -> Bool Source # (/=) :: HsBootOrSig -> HsBootOrSig -> Bool Source #
Ord HsBootOrSig Source # |

Instance details

Defined in GHC.Types.SourceFile

Methods

compare :: HsBootOrSig -> HsBootOrSig -> Ordering Source #

(<) :: HsBootOrSig -> HsBootOrSig -> Bool Source #

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

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

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

max :: HsBootOrSig -> HsBootOrSig -> HsBootOrSig Source #

min :: HsBootOrSig -> HsBootOrSig -> HsBootOrSig Source #

hscSourceToIsBoot :: HscSource -> IsBootInterface Source #

Tests if an `HscSource` is a boot file, primarily for constructing elements of `BuildModule`. We conflate signatures and modules because they are bound in the same namespace; only boot interfaces can be disambiguated with `import {-# SOURCE #-}`.

isHsBootOrSig :: HscSource -> Bool Source #

isHsBootFile :: HscSource -> Bool Source #

isHsigFile :: HscSource -> Bool Source #

hscSourceString :: HscSource -> String Source #