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

Is an import a safe import?

data SafeHaskellMode #

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

data IfaceTrustInfo #

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

#### Instances

Instances details

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

getSafeMode :: IfaceTrustInfo -> SafeHaskellMode #

setSafeMode :: SafeHaskellMode -> IfaceTrustInfo #

noIfaceTrustInfo :: IfaceTrustInfo #