HORIZON HASKELLDocslts/ghc-10.0.x8174fa42026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Foreign function interface declarations

0 declarations

Data-type

datadata ForeignDecl pass
#
Instances6Data, Outputable, ToHie, Anno

Record synonym

Foreign call

1 declaration

Queries

CCallSpec

Foreign export types

0 declarations

Data-type

datadata ForeignExport pass
#

Specification of an externally exported entity in dependence on the calling convention

Constructors

Instances5Data, Outputable, ToHie

Specification

Foreign import types

0 declarations

Data-type

datadata ForeignImport pass
#

Specification Of an imported external entity in dependence on the calling convention

Constructors

  • CImport (XCImport pass) (XRec pass CCallConv) (XRec pass Safety) (Maybe (Header pass)) (CImportSpec pass)

    Import of a C entity

    • the two strings specifying a header file or library may be empty, which indicates the absence of a header or object specification (both are not used in the case of CWrapper and when CFunction has a dynamic target)

    • the calling convention is irrelevant for code generation in the case of CLabel, but is needed for pretty printing

    • Safety is irrelevant for CLabel and CWrapper

  • XForeignImport !(XXForeignImport pass)
Instances5Data, Outputable, ToHie

Call target

datadata CCallTarget pass
#

How to call a particular function in C-land.

Constructors

Instances6Eq, Data, NFData, Binary

GHC extension point

datadata StaticTargetGhc
#

Constructors

Instances4Eq, Data, NFData, Binary

Which compilation Unit is the static target in, either it is in this currently compiling compilation Unit, or it is in that other, compilation Unit.

Constructors

Instances4Eq, Data, NFData, Binary

Queries

Foreign target kind

datadata ForeignKind
#

Constructors

Instances6Enum, Eq, Data, Show, NFData, Binary
  • Enum ForeignKindDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.Foreign
  • Eq ForeignKindDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.Foreign
  • Data ForeignKindDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.Foreign
  • Show ForeignKindDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.Foreign
  • NFData ForeignKindDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.Foreign
  • Binary ForeignKindDefined in ghc-10.0.0.20260917 · GHC.Types.ForeignCall · orphan

Safety

datadata Safety
#

Constructors

  • PlaySafe

    Might invoke Haskell GC, or do a call back, or switch threads, etc. So make sure things are tidy before the call. Additionally, in the threaded RTS we arrange for the external call to be executed by a separate OS thread, i.e., _concurrently_ to the execution of other Haskell threads.

  • PlayInterruptible

    Like PlaySafe, but additionally the worker thread running this foreign call may be unceremoniously killed, so it must be scheduled on an unbound thread.

  • PlayRisky

    None of the above can happen; the call will return without interacting with the runtime system at all. Specifically:

    • No GC

    • No call backs

    • No blocking

    • No precise exceptions

Instances8Enum, Eq, Data, Show, NFData, Outputable, …
  • Enum SafetyDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.Foreign
  • Eq SafetyDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.Foreign
  • Data SafetyDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.Foreign
  • Show SafetyDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.Foreign
  • NFData SafetyDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.Foreign
  • Outputable SafetyDefined in ghc-10.0.0.20260917 · GHC.Types.ForeignCall · orphan
  • Binary SafetyDefined in ghc-10.0.0.20260917 · GHC.Types.ForeignCall · orphan
  • type Anno Safety = EpaLocationDefined in ghc-10.0.0.20260917 · GHC.Hs.Decls · orphan

Queries

Specification

Foreign binding type

0 declarations

Data-type

datadata CType pass
#

A C type, used in CAPI FFI calls

Constructors

Instances7Data, NFData, Outputable, Binary, Anno, …

Construction

Conversion

GHC extension point

General sub-types

0 declarations

CCallConv

datadata CCallConv
#
Instances8Enum, Eq, Data, Show, NFData, Outputable, …
  • Enum CCallConvDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.Foreign
  • Eq CCallConvDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.Foreign
  • Data CCallConvDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.Foreign
  • Show CCallConvDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.Foreign
  • NFData CCallConvDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.Foreign
  • Outputable CCallConvDefined in ghc-10.0.0.20260917 · GHC.Types.ForeignCall · orphan
  • Binary CCallConvDefined in ghc-10.0.0.20260917 · GHC.Types.ForeignCall · orphan
  • type Anno CCallConv = EpaLocationDefined in ghc-10.0.0.20260917 · GHC.Hs.Decls · orphan

Default construction

Pretty-printing

CLabelString

Queries

Pretty-printing

Header

datadata Header pass
#

Constructors

Instances7Eq, Data, NFData, Outputable, Binary, …
  • Eq (Header (GhcPass p))Defined in ghc-10.0.0.20260917 · GHC.Types.ForeignCall · orphan
  • Data (Header GhcPs)Defined in ghc-10.0.0.20260917 · GHC.Hs.Instances · orphan
  • Data (Header GhcRn)Defined in ghc-10.0.0.20260917 · GHC.Hs.Instances · orphan
  • Data (Header GhcTc)Defined in ghc-10.0.0.20260917 · GHC.Hs.Instances · orphan
  • NFData (Header (GhcPass p))Defined in ghc-10.0.0.20260917 · GHC.Types.ForeignCall · orphan
  • Outputable (Header (GhcPass p))Defined in ghc-10.0.0.20260917 · GHC.Types.ForeignCall · orphan
  • Binary (Header (GhcPass p))Defined in ghc-10.0.0.20260917 · GHC.Types.ForeignCall · orphan

Conversion

Orphan instances

17 instances