[Haskell-cafe] How to execute a function loaded via GHCI.ObjLink?

Saurabh Nanda saurabhnanda at gmail.com
Fri Jul 28 07:05:45 UTC 2017


>
> I have a blogpost which demonstrates this
> https://purelyfunctional.org/posts/2016-05-20-dynamic-
> loading-haskell-module.html


Hey Moritz, I'm not sure if you realised, but my code is based on your blog
post itself -- thanks for writing it! It was just that I was trying to
avoid using the `mangleSymbol` function by hard-coding the known symbol
value. If I use the `mangleSymbol` method, the symbol lookup fails. If I
hard-code the symbol name and try executing the function it segfaults.

I'm stuck now and don't know enough about the internals of Ptr, FuncPtr,
Any, etc. to figure out how to proceed. I'm on MacOSX if that makes any
difference.

-- Saurabh.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170728/a542741e/attachment.html>


More information about the Haskell-Cafe mailing list