ghc-lib-parser-9.10.1.20250103: 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 #

Constructors

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

Bundled Patterns

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

#### Instances

Instances details

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

data HsBootOrSig #

Constructors

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

#### Instances

Instances details

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

hscSourceToIsBoot :: HscSource -> IsBootInterface #

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 #

isHsBootFile :: HscSource -> Bool #

isHsigFile :: HscSource -> Bool #

hscSourceString :: HscSource -> String #