runGhc' :: [String] -> Ghc a -> IO a
runGhc' args act = do
    let libdir = head args
        flags  = tail args
    (dynFlags, _warns) <- parseStaticFlags (map noLoc flags)
    runGhc (Just libdir) $ do
      dflags0 <- getSessionDynFlags
      (dflags1, _leftover, _warns) <- parseDynamicFlags dflags0 dynFlags
      let dflags2 = dflags1 {
              hscTarget = HscInterpreted
            , ghcLink   = LinkInMemory
            , verbosity = 1
            }
      _newPkgs <- setSessionDynFlags dflags2
      act
runGhc' :: [String] -> Ghc a -> IO a
runGhc' args act = do
    let libdir = head args
        flags  = tail args
    (dynFlags, _warns) <- parseStaticFlags (map noLoc flags)
    runGhc (Just libdir) $ do
      dflags0 <- getSessionDynFlags
      (dflags1, _leftover, _warns) <- parseDynamicFlags dflags0 dynFlags
      let dflags2 = dflags1 {
              hscTarget = HscInterpreted
            , ghcLink   = LinkInMemory
            , verbosity = 1
            }
      _newPkgs <- setSessionDynFlags dflags2
      act
runGhc' args act = do
    let libdir = head args
        flags  = tail args
    (dynFlags, _warns) <- parseStaticFlags (map noLoc flags)
    runGhc (Just libdir) $ do
      dflags0 <- getSessionDynFlags
      (dflags1, _leftover, _warns) <- parseDynamicFlags dflags0 dynFlags
      let dflags2 = dflags1 {
              hscTarget = HscInterpreted
            , ghcLink   = LinkInMemory
            , verbosity = 1
            }
      _newPkgs <- setSessionDynFlags dflags2
      act