Find our JIT'ed function and run it master
authorLuke Lau <luke_lau@icloud.com>
Sun, 2 Jun 2019 18:33:35 +0000 (19:33 +0100)
committerLuke Lau <luke_lau@icloud.com>
Sun, 2 Jun 2019 18:33:35 +0000 (19:33 +0100)
commit4d4c0e626e0002e19345a1fd47145c1701583d4c
tree91234630c98023cc9522bd70d1293fe72ad76a16
parent2fd7e4f3686c3b977881f995ec12b8dd60e72254
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