ForeignCall

ghc-7.6.3: The GHC API

Safe Haskell | None

ForeignCall

Synopsis

- newtype ForeignCall = CCall CCallSpec
- isSafeForeignCall :: ForeignCall -> Bool
- data Safety
  - = PlaySafe
  - | PlayInterruptible
  - | PlayRisky
- playSafe :: Safety -> Bool
- playInterruptible :: Safety -> Bool
- data CExportSpec = CExportStatic CLabelString CCallConv
- type CLabelString = FastString
- isCLabelString :: CLabelString -> Bool
- pprCLabelString :: CLabelString -> SDoc
- data CCallSpec = CCallSpec CCallTarget CCallConv Safety
- data CCallTarget
  - = StaticTarget CLabelString (Maybe PackageId) Bool
  - | DynamicTarget
- isDynamicTarget :: CCallTarget -> Bool
- data CCallConv
  - = CCallConv
  - | CApiConv
  - | StdCallConv
  - | CmmCallConv
  - | PrimCallConv
- defaultCCallConv :: CCallConv
- ccallConvToInt :: CCallConv -> Int
- ccallConvAttribute :: CCallConv -> SDoc
- newtype Header = Header FastString
- data CType = CType (Maybe Header) FastString

# Documentation

newtype ForeignCall

Constructors

CCall CCallSpec |

Instances

Eq ForeignCall |
Outputable ForeignCall |
Binary ForeignCall |

isSafeForeignCall :: ForeignCall -> Bool

data Safety

Constructors

PlaySafe |
PlayInterruptible |
PlayRisky |

Instances

Eq Safety |
Data Safety |
Show Safety |
Typeable Safety |
Outputable Safety |
Binary Safety |

playSafe :: Safety -> Bool

playInterruptible :: Safety -> Bool

data CExportSpec

Constructors

CExportStatic CLabelString CCallConv |

Instances

Data CExportSpec |
Typeable CExportSpec |
Outputable CExportSpec |
Binary CExportSpec |

type CLabelString = FastString

isCLabelString :: CLabelString -> Bool

pprCLabelString :: CLabelString -> SDoc

data CCallSpec

Constructors

CCallSpec CCallTarget CCallConv Safety |

Instances

Eq CCallSpec |
Outputable CCallSpec |
Binary CCallSpec |

data CCallTarget

How to call a particular function in C-land.

Constructors

StaticTarget CLabelString (Maybe PackageId) Bool |
DynamicTarget |

Instances

Eq CCallTarget |
Data CCallTarget |
Typeable CCallTarget |
Binary CCallTarget |

isDynamicTarget :: CCallTarget -> Bool

data CCallConv

Constructors

CCallConv |
CApiConv |
StdCallConv |
CmmCallConv |
PrimCallConv |

Instances

Eq CCallConv |
Data CCallConv |
Typeable CCallConv |
Outputable CCallConv |
Binary CCallConv |

defaultCCallConv :: CCallConv

ccallConvToInt :: CCallConv -> Int

ccallConvAttribute :: CCallConv -> SDoc

newtype Header

Constructors

Header FastString |

Instances

Eq Header |
Data Header |
Typeable Header |
Outputable Header |
Binary Header |

data CType

A C type, used in CAPI FFI calls

Constructors

CType (Maybe Header) FastString |

Instances

Data CType |
Typeable CType |
Outputable CType |
Binary CType |