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>
Mon, 3 Jun 2019 23:15:37 +0000 (00:15 +0100)
commit30d298135396c1e988ddb0453484153928d48303
tree91234630c98023cc9522bd70d1293fe72ad76a16
parent61265b69ce5b6ec9ed6889fce8f7bbe32bb31973
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