1

I am following an Asteroids tutorial in Haskell(Haskeroids) and I'm having a problem with my submodules. Basically, my folder structure is like this:

project/
|-- main.hs
|-- Haskeroids/
    |-- Geometry.hs
    |-- Geometry/
        |-- Transform.hs

The Geometry.hs file has

module Haskeroids.Geometry where

while the Transform.hs file has

module Haskeroids.Geometry.Transform where
import Haskeroids.Geometry

for some reason, ghc seems to look for Geometry/Haskeroids/Geometry.hs. is there some setting to set so that ghc knows where to look for the file, and what is the way to set it for haskell-mode?

Edit: the error message was: Could not find module Haskeroids.Geometry. Use - v to see a list of the files searched

N. Silvestrin
  • 21
  • 1
  • 5

1 Answers1

0

I had a look at the project you linked to and inspected the cabal file - as I suggested you are not mentioning Haskeroids stuff there.

 ..

Executable haskeroids
    Main-is:            main.hs

    Other-modules:      Haskeroids.Geometry
                 ,      Haskeroids.Geometry.Transform

    Build-Depends:      base >= 4, transformers >= 0.2.2.0,
                        ...

add the Other-modules part to your cabal file and everything should work well and dandy.

epsilonhalbe
  • 15,637
  • 5
  • 46
  • 74