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

NFData HscSource # |
Instance details Defined in GHC.Types.SourceFile Methods rnf :: HscSource -> () #
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_ :: WriteBinHandle -> HscSource -> IO () # put :: WriteBinHandle -> HscSource -> IO (Bin HscSource) # get :: ReadBinHandle -> 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

NFData HsBootOrSig # |
Instance details Defined in GHC.Types.SourceFile Methods rnf :: HsBootOrSig -> () #
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 #