macoshaskellemacshaskell-mode

How do you get Emacs haskell-mode to find modules in other hs-source-dirs?


UPDATE: clarified that this is on Mac OS X

I'm using Emacs Prelude (which uses haskell-mode) on Mac OS X and I've created a project with stack new hello.

The project it generates is like this:

If I open Main.hs in Emacs it shows this:

module Main where

import Lib

main :: IO ()
main = someFunc

But Lib is underlined as an error and placing my caret there shows this:

Could not find module 'Lib'
Use -v to see a list of the files searched for.

How do you get Emacs haskell-mode to find modules in other hs-source-dirs?


Solution

  • The greatest horror is that I fixed this by rebooting.

    I appear to have triggered it by breaking the path to Stack. The path changed from my original manual install to ~/Applications/bin/stack to ~/.local/bin/stack. I knew that had changed so I closed and relaunched Emacs, but the problem persisted.

    Rebooting fixed it. This brings me sadness. I imagine logging out might have worked just as well.