ghc-7.8.4: The GHC API

Safe Haskell | None
Language | Haskell98

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
  - | PrimCallConv
  - | JavaScriptCallConv
- 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 |
Outputable Safety |
Binary Safety |
Typeable * Safety |

playSafe :: Safety -> Bool

playInterruptible :: Safety -> Bool

data CExportSpec

Constructors

CExportStatic CLabelString CCallConv |

Instances

Data CExportSpec |
Outputable CExportSpec |
Binary CExportSpec |
Typeable * 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 |
Binary CCallTarget |
Typeable * CCallTarget |

isDynamicTarget :: CCallTarget -> Bool

data CCallConv

Constructors

CCallConv |
CApiConv |
StdCallConv |
PrimCallConv |
JavaScriptCallConv |

Instances

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

defaultCCallConv :: CCallConv

ccallConvToInt :: CCallConv -> Int

ccallConvAttribute :: CCallConv -> SDoc

newtype Header

Constructors

Header FastString |

Instances

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

data CType

A C type, used in CAPI FFI calls

Constructors

CType (Maybe Header) FastString |

Instances

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