0

So I have a very basic haskell file that looks like this :

main = thing
thing = print "hi"

When I run the ghc-mod command to get info on the main function like this : 'ghc-mod info file.hs main', I get the proper result :

main :: IO () -- Defined at file.hs:1:1

But then if I try 'ghc-mod info file.hs thing', it doesn't output anything at all, not even a blank line or error. I have version 5.2.0.0 of ghc-mod, and version 7.8.3 of GHC. How can I get ghc-mod info to work?

Marcus Buffett
  • 1,289
  • 1
  • 14
  • 32
  • 2
    If you have no module name, it is `module Main (main) where`, so main is the only visible thing it can check. – user2407038 Oct 31 '14 at 07:47

1 Answers1

2

Apparently, ghc-mod needs you to put a module Something where at the beginning of your source file in order to work correctly.

zigazou
  • 1,725
  • 9
  • 13
  • Of course, after spending hours trying to figure it out and reinstalling haskell, ghc-mod, vim, etc., it's a one line fix... Thanks! – Marcus Buffett Oct 31 '14 at 12:23