ghc-9.6.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Types.SourceFile

Synopsis

- data HscSource
  - = HsSrcFile
  - | HsBootFile
  - | HsigFile
- hscSourceToIsBoot :: HscSource -> IsBootInterface
- isHsBootOrSig :: HscSource -> Bool
- isHsigFile :: HscSource -> Bool
- hscSourceString :: HscSource -> String

# Documentation

data HscSource Source #

Constructors

HsSrcFile | .hs file
HsBootFile | .hs-boot file
HsigFile | .hsig file

#### 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_ :: BinHandle -> HscSource -> IO () Source # put :: BinHandle -> HscSource -> IO (Bin HscSource) Source # get :: BinHandle -> IO HscSource Source #
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 #

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 #

isHsigFile :: HscSource -> Bool Source #

hscSourceString :: HscSource -> String Source #