
I would LOVE someone to improve the documentation for addTopDecls. Manuel Chakravarty and Geoff Mainland were responsible for the implementation.
Simon
| -----Original Message-----
| From: ghc-devs [mailto:ghc-devs-bounces@haskell.org] On Behalf Of Michael
| Sloan
| Sent: 11 February 2015 23:19
| To: Francesco Mazzoli
| Cc: ghc-devs@haskell.org; haskell
| Subject: Re: [Haskell-cafe] Anonymous FFI calls
|
| It seems like addTopDecls[1] will able to help here. Unfortunately,
| the function is not well documented and not very discoverable because
| it's only exported by Language.Haskell.TH.
|
| The documentation doesn't mention that it can only be used to create
| new top level functions and FFI imports[2]. I think that adding FFI
| imports was the main motivation for implementing it. In the past
| I've wanted to generate instances via this function, but unfortunately
| it's not implemented..
|
| Hope that helps!
| -Michael
|
| [1] http://hackage.haskell.org/package/template-haskell-
| 2.9.0.0/docs/Language-Haskell-TH-Syntax.html#v:addTopDecls
|
| [2]
| https://github.com/ghc/ghc/blob/1d982ba10f590828b78eba992e73315dee33f78a/
| compiler/typecheck/TcSplice.hs#L818
|
| On Wed, Feb 11, 2015 at 2:26 AM, Francesco Mazzoli