Hello Haskell community,
I\'m new to Haskell and ran into a problem when I tried to structure my first bigger project.
Here\'s the minimal example of the problem
Edit: September 2016
Since I originally answered this question there is a growing practice of defining Foo.Internal
modules that are still exposed. In the original answer below I suggested using the other-modules
field. A practice that is now popular is to define Foo.Internal.*
modules that are exposed but explicitly not part of the supported API. The rational for this pattern is explained in the answers to this question.
As noted in the comments your .cabal
file is missing the other-modules
line. I think cabal install
then only installs FoodMod1
since that is all it's been told about.
This is a nice way to create internal modules with, for instance, types that are used throughout your cabal package which you don't want to expose in the package API. Since the other-modules
modules cannot be imported from outside your package it allows you to create package private functionality.