How can I dynamically load someone else's library?

Is there a Haskell equivalent for POSIX ' dlopenor Windows' LoadLibrary? It seems that all FFI materials work with the libraries specified at the time of the link.

+4
source share
1 answer

Fast hoogling calls System.Posix.DynamicLinker . You can also try the plugins package for higher-level materials.

For Windows, System.Win32.DLL exists . The result of getProcAddress can be converted to a function pointer using castPtrToFunPtr .

+4
source

Source: https://habr.com/ru/post/1531960/


All Articles