0
votes

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?

1
If you have no module name, it is module Main (main) where, so main is the only visible thing it can check.user2407038

1 Answers

2
votes

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