Using -fext-core without a Main function

Hal Daume III hal at
Tue Apr 13 12:38:05 EDT 2010

If I have a file 'Foo.hs' that contains one line 'addOne x = x + 1', I 
want to run something like:

   ghc -c -fext-core Foo.hs

to get the core version of this file.

Unfortunately, when I do that, it complains that Main doesn't have a 
function main.  And it doesn't produce the .hcr file.

I tried adding -no-hs-main but that doesn't help.

I can add 'main = undefined' to Foo.hs, but then the core file doesn't 
contain the declaration of addOne because it's not used.

Any suggestions?



  Hal Daume III --- me AT hal3 DOT name  |  http://www DOT hal3 DOT name
  "Arrest this man, he talks in maths."  |

More information about the Glasgow-haskell-users mailing list