This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----------------------------------------------------------------------------- | |
-- | Example for loading Haskell source code dynamically using the GHC api | |
-- Tested on ghc 7.4.2 | |
-- | |
-- Useful links: | |
-- GHC api: | |
-- http://www.haskell.org/ghc/docs/latest/html/libraries/ghc/GHC.html | |
-- Wiki: | |
-- http://www.haskell.org/haskellwiki/GHC/As_a_library | |
----------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE ScopedTypeVariables #-} | |
module Blog.DynLoad ( | |
loadSourceGhc, | |
execFnGhc | |
) where | |
{- | |
Source: | |
http://codeutopia.net/blog/2011/08/20/adventures-in-haskell-dynamic-loading-and-compiling-of-modules/ | |
https://gist.github.com/jhartikainen/1158986 |