I am trying to compile haskell to JS using Fay with one directory after the --include
option like so:
fay --include src\Tmv src\Tmv\Client\Main.hs
There is a SharedTypes.hs file in src\Tmv which defines a module Tmv.SharedTypes
that is used in Client\Main.hs. I get the following error:
Could not find module "Tmv.SharedTypes". Use -v to see a list of files searched for.
The -v option does not work. I have tried several variations of the parameters, eg. absolute paths, quotation marks, escaped (double) backslashes.
Configuration: fay 0.10.1.0, ghc 7.4.2 (i386), Windows 7 x64
Moving this from a comment, since it apparently resolved the problem:
When GHC looks for source files, normally it expects a module Foo.Bar
to be found as Bar.hs
in a subdirectory Foo
, relative to whatever "root" directory it starts from. For example, if you start GHCi with Foo
as the current directory, you'll have problems with the module Bar
either not being found, or errors because the module name won't match what GHC expects.
Since the same rules seem to be in play in your case, to import Tmv.SharedTypes
you want SharedTypes.hs
to be in a Tmv
subdirectory of whatever the base path is, so either creating another Tmv
subdirectory or specifying src
alone for --include
should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With