I write some codes in the Real World Haskell chapter 5 SimpleJSON in eclipse I run PrettyJSON using GHCi, it said that
C:\Users\vxanica\Haskell Workspace\SimpleJSON\src\PrettyJSON.hs:5:8:
Could not find module `SimpleJSON':
Use -v to see a list of the files searched for.
However I load the same file in WinGHCi it is OK, it said
Compiling SimpleJSON ( SimpleJSON.hs, interpreted )
Compiling PrettyJSON ( PrettyJSON.hs, interpreted )
Ok, modules loaded: PrettyJSON, SimpleJSON.
just don't know the reason
many thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Try to add your modules to your executable via the other-modules directive (or right click on each module, go to module inclusion and check the check boxes)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As far as I know, cabal does not require an executable to have all the 'other-module' directive in it. I thought it is only for libraries. Why is EclipseFP different in this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Mmmhh, I'm not sure, something to do with the default folder in which we run? We probably launch ghci in the project folder, where vxanica launches WinGHCi from the src folder…
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I suppose that the default folder is the project folder, in a new project i have to put the file in the root of the project folder for readFile function which is in a hs file in src folder. Same for the dll files since I use glut.dll to plot. I do not know how to set the default project worksapce path like in Visual Studio 2010.
I am not quite sure what the check boxes refer to.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
sorry to post so much.
I try many times, I really think there a little bit problem here.
for example I got three files in src folder Glob.hs, GlobRegex.hs,Main.hs
Glob.hs import GlobRegex file.
in src folder if I run I will get an error.
but if I copy the GlobRegex.hs to the root folder of my project
I can run Glob.hs in src folder
I think there is a problem with linking and compiling.
when it is checking, it will checking the files in src folder
However, when it is linking the modules the files in the root folder are loaded.
Which means that I have to keep double copies in both src folder and root folder to make the file be imported.
I am not sure any others encountered a problem like this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If I bother you, I am very sorry. I am just a starter. used to use Leksah, but I just prefer eclipse more! Java C Haskell all in one! it is just convenient. thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No problem. I'm not very clear on what you're trying to achieve though. Maybe you could zip your project folder (the source, the cabal file, etc) and send it to me directly. My email is at the bottom of the release notes (https://sourceforge.net/projects/eclipsefp/files/EclipseFP%202%20branch/2.1.0/). Also send instructions on what operations you're trying to do.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I write some codes in the Real World Haskell chapter 5 SimpleJSON in eclipse I run PrettyJSON using GHCi, it said that
C:\Users\vxanica\Haskell Workspace\SimpleJSON\src\PrettyJSON.hs:5:8:
Could not find module `SimpleJSON':
Use -v to see a list of the files searched for.
However I load the same file in WinGHCi it is OK, it said
Compiling SimpleJSON ( SimpleJSON.hs, interpreted )
Compiling PrettyJSON ( PrettyJSON.hs, interpreted )
Ok, modules loaded: PrettyJSON, SimpleJSON.
just don't know the reason
many thanks
Do you have a cabal file that reference properly the source folders, and all the modules you want to build?
yes in the cabal file
name: SimpleJSON
version: 0.1
cabal-version: >= 1.2
build-type: Simple
executable SimpleJSON
hs-source-dirs: src
main-is: Main.hs
build-depends: base >= 4
ghc-options: -Wall
I think it is OK.
Try to add your modules to your executable via the other-modules directive (or right click on each module, go to module inclusion and check the check boxes)
As far as I know, cabal does not require an executable to have all the 'other-module' directive in it. I thought it is only for libraries. Why is EclipseFP different in this?
Mmmhh, I'm not sure, something to do with the default folder in which we run? We probably launch ghci in the project folder, where vxanica launches WinGHCi from the src folder…
I suppose that the default folder is the project folder, in a new project i have to put the file in the root of the project folder for readFile function which is in a hs file in src folder. Same for the dll files since I use glut.dll to plot. I do not know how to set the default project worksapce path like in Visual Studio 2010.
I am not quite sure what the check boxes refer to.
I found that there is no red waves under the module I imported, so the editor is happy and can see the module. but it cannot run.
sorry to post so much.
I try many times, I really think there a little bit problem here.
for example I got three files in src folder Glob.hs, GlobRegex.hs,Main.hs
Glob.hs import GlobRegex file.
in src folder if I run I will get an error.
but if I copy the GlobRegex.hs to the root folder of my project
I can run Glob.hs in src folder
I think there is a problem with linking and compiling.
when it is checking, it will checking the files in src folder
However, when it is linking the modules the files in the root folder are loaded.
Which means that I have to keep double copies in both src folder and root folder to make the file be imported.
I am not sure any others encountered a problem like this.
If I bother you, I am very sorry. I am just a starter. used to use Leksah, but I just prefer eclipse more! Java C Haskell all in one! it is just convenient. thanks.
No problem. I'm not very clear on what you're trying to achieve though. Maybe you could zip your project folder (the source, the cabal file, etc) and send it to me directly. My email is at the bottom of the release notes (https://sourceforge.net/projects/eclipsefp/files/EclipseFP%202%20branch/2.1.0/). Also send instructions on what operations you're trying to do.