[Haskell-beginners] ghc-mod and cabal "could not find module Prelude"
Alan Buxton
alanbuxton at gmail.com
Tue Jun 23 14:48:18 UTC 2015
Hi
I've recently set up a new Haskell working environment on Ubuntu 14.04. I
installed the Ubuntu packaged version of Haskell platform.
My problem is that I can't now get ghc-mod check to work if there is a cabal
file in the current directory.
I am using:
* ghc-mod 5.2.1.2 compiled by GHC 7.6.3
* cabal 1.16.0.2
See below an extract of trying to run ghc-mod check in a directory that was
empty until I just ran cabal init in it:
~/tmp-ghc-mod$ ls
Setup.hs tmp-ghc-mod.cabal
~/tmp-ghc-mod$ ghc-mod check Setup.hs
Setup.hs:1:1:Could not find module `Prelude'It is a member of the hidden
package `base'.Perhaps you need to add `base' to the build-depends in your
.cabal file.It is a member of the hidden package `haskell98-2.0.0.2'.Perhaps
you need to add `haskell98' to the build-depends in your .cabal file.It is a
member of the hidden package `haskell2010-1.1.1.0'.Perhaps you need to add
`haskell2010' to the build-depends in your .cabal file.Use -v to see a list
of the files searched for.
~/tmp-ghc-mod$ mv tmp-ghc-mod.cabal tmp-ghc-mod.cabal.NOT
~/tmp-ghc-mod$ ls
dist Setup.hs tmp-ghc-mod.cabal.NOT
~/tmp-ghc-mod$ ghc-mod check Setup.hs
Setup.hs:2:1:Warning: Top-level binding with no type signature: main :: IO
()
~/tmp-ghc-mod$
So. ghc-mod behaves as expected when there is no cabal file, but doesn't
behave as expected if there is a cabal file.
My google fu isn't helping me out on this: the only issues I have seen are
to do with a change in format of the cabal file in newer versions of cabal.
Any ideas?
Thanks
Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150623/29ac55de/attachment-0001.html>
More information about the Beginners
mailing list