Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

th-build in GHCi: phase `C pre-processor' failed (exitcode = 1) #2

Open
sheganinans opened this issue Dec 27, 2015 · 0 comments
Open

Comments

@sheganinans
Copy link

Hi, excellent package you have here. Works perfectly (with some version bumps) when I compile it with GHC 7.10. However when I attempt to use a piece of code using your package in GHCi I get this error:

$> stack repl
GHCi, version 7.10.2: http://www.haskell.org/ghc/  :? for help
unknown option: 'c'
gcc: fatal error: cannot specify -o with -c, -S or -E with multiple files
compilation terminated.
phase `C pre-processor' failed (exitcode = 1)
λ> 

The code looks like:

{-# LANGUAGE TemplateHaskell #-}
module Main where

import Language.Haskell.TH
import Language.Haskell.TH.Build

mkExpr :: forall a. Ppr a => Q a -> IO String
mkExpr = (return . pprint =<<) . runQ

testVal = valD' "foo" (appE' 'not 'True) ()

main :: IO ()
main = putStrLn =<< mkExpr testVal

When I compile it, I get exactly what you would expect:

foo = GHC.Classes.not GHC.Types.True

But GHCi complains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant