Vasili I. Galchin wrote:
Hello,
Should namespace designation be specified in modules or in the .cabal file? Or to put it another way should a relative namespace be specified in a Haskell module and the remaining "top" part be specified in the associated .cabal file? Of course, yes/no answers are probably not sufficient ... i.e. please elaborate.

This is my, probably incomplete, understanding of how things work.

The module statement at the top of a Haskell source file should contain the complete name, e.g.

    module Foo.Bar.Baz

If you use GHC directly to build (e.g. using --make) then it will look for the module above at $x/Foo/Bar/Baz.hs, where $x is on of the paths where GHC has been told to look (e.g. using -i).

In a Cabal file you mention the complete names of module you use/build (e.g. Foo.Bar.Baz above). Hs-Source-Dirs adds directories to the paths where GHC looks for modules ($x above).

/M

--
Magnus Therning                        (OpenPGP: 0xAB4DFBA4)
magnus@therning.org          Jabber: magnus@therning.org
http://therning.org/magnus         identi.ca|twitter: magthe

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to