module Main where import System.Plugin import Unsafe.Coerce main = do val <- pdynload ("Prelude", "reverse") ("", "String -> String") let str = case val of Just v -> (unsafeCoerce v :: String -> String) "hello" Nothing -> "Load failed." print str