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

Safe Haskell | Ignore
Language | GHC2021

GHC.Types.SafeHaskell

Description

This stuff here is related to supporting the Safe Haskell extension, primarily about storing under what trust type a module has been compiled.

Synopsis

- type IsSafeImport = Bool
- data SafeHaskellMode
  - = Sf_None
  - | Sf_Unsafe
  - | Sf_Trustworthy
  - | Sf_Safe
  - | Sf_SafeInferred
  - | Sf_Ignore
- data IfaceTrustInfo
- getSafeMode :: IfaceTrustInfo -> SafeHaskellMode
- setSafeMode :: SafeHaskellMode -> IfaceTrustInfo
- noIfaceTrustInfo :: IfaceTrustInfo

# Documentation

type IsSafeImport = Bool Source #

Is an import a safe import?

data SafeHaskellMode Source #

The various Safe Haskell modes

Constructors

Sf_None | inferred unsafe
Sf_Unsafe | declared and checked
Sf_Trustworthy | declared and checked
Sf_Safe | declared and checked
Sf_SafeInferred | inferred as safe
Sf_Ignore | `-fno-safe-haskell` state

#### Instances

Instances details

Show SafeHaskellMode Source # |
Instance details Defined in GHC.Types.SafeHaskell Methods showsPrec :: Int -> SafeHaskellMode -> ShowS Source # show :: SafeHaskellMode -> String Source # showList :: [SafeHaskellMode] -> ShowS Source #
Outputable SafeHaskellMode Source # |
Instance details Defined in GHC.Types.SafeHaskell Methods ppr :: SafeHaskellMode -> SDoc Source #
Eq SafeHaskellMode Source # |
Instance details Defined in GHC.Types.SafeHaskell Methods (==) :: SafeHaskellMode -> SafeHaskellMode -> Bool Source # (/=) :: SafeHaskellMode -> SafeHaskellMode -> Bool Source #

data IfaceTrustInfo Source #

Safe Haskell information for `ModIface` Simply a wrapper around SafeHaskellMode to separate iface and flags

#### Instances

Instances details

Binary IfaceTrustInfo Source # |
Instance details Defined in GHC.Types.SafeHaskell Methods put_ :: WriteBinHandle -> IfaceTrustInfo -> IO () Source # put :: WriteBinHandle -> IfaceTrustInfo -> IO (Bin IfaceTrustInfo) Source # get :: ReadBinHandle -> IO IfaceTrustInfo Source #
Outputable IfaceTrustInfo Source # |
Instance details Defined in GHC.Types.SafeHaskell Methods ppr :: IfaceTrustInfo -> SDoc Source #

getSafeMode :: IfaceTrustInfo -> SafeHaskellMode Source #

setSafeMode :: SafeHaskellMode -> IfaceTrustInfo Source #

noIfaceTrustInfo :: IfaceTrustInfo Source #