GHC.Types.SourceFile

ghc-9.10.0.20240328: The GHC API

Safe Haskell | None
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

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