79081552

Date: 2024-10-12 17:43:43
Score: 0.5
Natty:
Report link

For me the solution by K. A. Buhr didn't work. If I put a module name that doesn't match the file such as the proposed

-- in Client.hs
module Main where

I get the error "File name does not match module name". I also can't call the file Main.hs because there is already another file called Main.hs.

The only way to solve this was to use

-- in Client.hs
module Client where

add the lines other-modules: [] and - -main-is Client to the package.yaml:

executables:
  ObjectServer:
    main:                Main.hs
    other-modules:       []
    source-dirs:         app
    ghc-options:
    - -threaded
    - -main-is Main
    dependencies:
    - ObjectServer
  Client:
    main:                Client.hs
    other-modules:       []
    source-dirs:         app
    ghc-options:
    - -threaded
    - -main-is Client
    dependencies:
    - ObjectServer
Reasons:
  • RegEx Blacklisted phrase (1): I get the error
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Kvothe