Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell: file name and path do not match module name

Tags:

module

haskell

I am using the Haskell app for OS X, and have created a Haskell project, and when I create another file in the project, Haskell tells me that the file name and path do not match the module name! I am new to Haskell, what does this mean?

It is telling me also that it is expecting the name of the file as the module name.

Thanks!

like image 266
manwholikesspritekit Avatar asked Feb 01 '26 01:02

manwholikesspritekit


1 Answers

The error message tells you that the module name and the file name should be the same.

E.g.: If the file name is NewModule.hs, the module name should be NewModule. E.g.

-- NewModule.hs:

module NewModule where

-- you may define functions here...

So, you just have to use the module directive.

like image 74
Michael Avatar answered Feb 02 '26 18:02

Michael



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!