Find our JIT'ed function and run it
authorLuke Lau <luke_lau@icloud.com>
Sun, 2 Jun 2019 18:33:35 +0000 (19:33 +0100)
committerLuke Lau <luke_lau@icloud.com>
Thu, 7 Nov 2019 17:11:27 +0000 (17:11 +0000)
commitf8ca631de5ee086f1f30d48b7fdd61b44639eb14
treefed013c927d22ff6fe9c732427f1bb1a53a23b16
parente82cbcc35f73376dcc628f8d537c80378e7ad4a7
Find our JIT'ed function and run it

Here is where the magic happens. We first mangle the symbol before
passing it to findSymbolIn: The compilation then happens here. It will
spit back a FFI pointer, which we then need to invoke ourselves.

In order to do this we have to specify the Haskell type of the function
that we're pointing to, which resides in C-land, hence the ccall
attribute in our foreign declaration.

Try it out!
Main.hs