ForeignCall

ghc-7.10.3: The GHC API

Safe Haskell | None
Language | Haskell2010

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 PackageKey) 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 SourceText (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 |

playSafe :: Safety -> Bool

playInterruptible :: Safety -> Bool

data CExportSpec

Constructors

CExportStatic CLabelString CCallConv |

Instances

Data 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 PackageKey) Bool |
DynamicTarget |

Instances

Eq CCallTarget |
Data CCallTarget |
Binary CCallTarget |

isDynamicTarget :: CCallTarget -> Bool

data CCallConv

Constructors

CCallConv |
CApiConv |
StdCallConv |
PrimCallConv |
JavaScriptCallConv |

Instances

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

defaultCCallConv :: CCallConv

ccallConvToInt :: CCallConv -> Int

ccallConvAttribute :: CCallConv -> SDoc

newtype Header

Constructors

Header FastString |

Instances

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

data CType

A C type, used in CAPI FFI calls

- `AnnKeywordId` : `AnnOpen` `'{-# CTYPE'`, `AnnHeader`,`AnnVal`, `AnnClose` `'#-}'`,

Constructors

CType SourceText (Maybe Header) FastString |

Instances

Data CType |
Outputable CType |
Binary CType |