Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

no output with LANGUAGE TemplateHaskell #62

Closed
mwotton opened this issue Apr 6, 2012 · 10 comments
Closed

no output with LANGUAGE TemplateHaskell #62

mwotton opened this issue Apr 6, 2012 · 10 comments

Comments

@mwotton
Copy link

mwotton commented Apr 6, 2012

rhino ➜ ~/projects/dojo/ninjablocks-zeromq-workers/src/channels git:(refactoring_channels) ✗ ghc-mod check T.hs
rhino ➜ ~/projects/dojo/ninjablocks-zeromq-workers/src/channels git:(refactoring_channels) ✗ ghc-mod check T2.hs
T2.hs:2:3:No instance for (Num [Char]) arising from the literal 1'Possible fix: add an instance declaration for (Num [Char])In the first argument of(==)', namely 1'In the expression: 1 == "1"In an equation forl': l = 1 == "1"
rhino ➜ ~/projects/dojo/ninjablocks-zeromq-workers/src/channels git:(refactoring_channels) ✗ cat T.hs
{-# LANGUAGE TemplateHaskell #-}
module T where
l=1=="1"
rhino ➜ ~/projects/dojo/ninjablocks-zeromq-workers/src/channels git:(refactoring_channels) ✗ cat T2.hs
module T2 where
l=1=="1"

@kazu-yamamoto
Copy link
Collaborator

I cannot reproduce this with ghc-mod compiled both with GHC 7.0.4 and GHC 7.4.1.

@kazu-yamamoto
Copy link
Collaborator

I meant that ghc-mod check displays the error in any cases.

@mwotton
Copy link
Author

mwotton commented Apr 6, 2012

I'm using 7.4 on Ubuntu. Will try on 7.

Sent from my iPhone

On 06/04/2012, at 12:50 AM, Kazu Yamamoto
reply@reply.github.com
wrote:

I meant that ghc-mod check displays the error in any cases.


Reply to this email directly or view it on GitHub:
#62 (comment)

@kazu-yamamoto
Copy link
Collaborator

I'm using Mac.

@exFalso
Copy link
Contributor

exFalso commented Apr 14, 2012

same issue on Arch using 7.4.1, calling "ghc-mod check" directly
did a bit of source digging and the problem seems to be a SomeException thrown which is caught by "ghandle ignore" (in withGHC) ignoring it
the error thrown is "ghc-mod: Something.hs:1:14-28: You can't use Template Haskell with a profiled compiler" which is a bit mysterious to me as compiling directly with ghc works fine (might actually be a bug in the ghc api?)
anyway it seems you need a profiled ghc to reproduce the bug. will try to recompile ghc without profiling and see whats what

@exFalso
Copy link
Contributor

exFalso commented Apr 14, 2012

hmm i just checked and my ghc is -not- built with profiling. a simple test compiler with the ghc api worked, so it might be some custom ghc-mod specific flag/option turned on that triggers the error message. either way the error should not be thrown

@exFalso
Copy link
Contributor

exFalso commented Apr 14, 2012

ok it thinks that the compiler is built with profiling when ghc-mod is built with it. the temporary solution is to rebuild ghc-mod without profiling.

@kazu-yamamoto
Copy link
Collaborator

Do you mean that you have a cabal configuration file which contains
executable-profiling: True
?

@exFalso
Copy link
Contributor

exFalso commented Apr 15, 2012

not anymore:)

@kazu-yamamoto
Copy link
Collaborator

Thank you. I can reproduce it now. It appeared that just ignoring exception is a bad idea. I modified ghc-mod so that it displays internal errors.

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

No branches or pull requests

3 participants