ghc-7.0.3: The GHC API

ForeignCall

Synopsis

- newtype ForeignCall = CCall CCallSpec
- data Safety
  - = PlaySafe Bool
  - | PlayRisky
- playSafe :: 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)
  - | DynamicTarget
- isDynamicTarget :: CCallTarget -> Bool
- data CCallConv
  - = CCallConv
  - | StdCallConv
  - | CmmCallConv
  - | PrimCallConv
- defaultCCallConv :: CCallConv
- ccallConvToInt :: CCallConv -> Int
- ccallConvAttribute :: CCallConv -> String

# Documentation

newtype ForeignCall

Constructors

CCall CCallSpec |

Instances

Eq ForeignCall |
Outputable ForeignCall |
Binary ForeignCall |

data Safety

Constructors

PlaySafe Bool |
PlayRisky |

Instances

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

playSafe :: 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) |
DynamicTarget |

Instances

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

isDynamicTarget :: CCallTarget -> Bool

data CCallConv

Constructors

CCallConv |
StdCallConv |
CmmCallConv |
PrimCallConv |

Instances

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

defaultCCallConv :: CCallConv

ccallConvToInt :: CCallConv -> Int

ccallConvAttribute :: CCallConv -> String