Open tdiesler opened 3 years ago
Hi. What backend are you using? ide-haskell-repl or ide-haskell-hls? In any case, it might be that you just need to reload the backend to force it to reread the cabal file. By far the simplest way to achieve this is to run Window: Reload
from Atom command palette.
I have this installed ...
The program works in ide-haskell-repl as well. Ctrl+Shift+P => Window: reload
makes no difference unfortunately.
I installed HLS like this
ghcup install hls
Hmm. I have a suspicion of what goes wrong exactly. Could you try opening week02
directory in Atom instead of the parent directory futurelearn
? You can do that from Atom by right-clicking on the week02
in the tree view and selecting "open in new window".
Yes, that works. So the cabal file must be in the root folder of the project? https://github.com/tdiesler/plutus-pioneer-program/tree/mystuff/futurelearn
Apparently so, but tbh it's an accident. I'll try to see if I can do something about it. In the meantime, I think cabal.project
file in futurelearn
directory with the following contents should convince hls to pick up the correct cabal file:
packages: */*.cabal
packages: */*.cabal
doesn't seem to work, but the Open in New Window
thing does work for now.
This is not a simple fix. In fact, I'm questioning the feasibility of the fix. This would need some rather drastic changes to some dependencies, which I have my doubts will be accepted.
However, I've verified the cabal.project
workaround and it works on my end; specifically, here's the diff:
diff --git a/futurelearn/cabal.project b/futurelearn/cabal.project
new file mode 100644
index 0000000..f44a24c
--- /dev/null
+++ b/futurelearn/cabal.project
@@ -0,0 +1 @@
+packages: */*.cabal
I figure this is a reasonable workaround for the time being. It needs to be documented though, as well as a bunch of other stuff.
As a heads-up, I'm transferring this issue to the relevant repo.
ok, thanks
Following the cabal getting stared guide, I created a project structure like this
In Atom I then get an error like this
The project cabal file contains this ...
The same happens with
import System.Random
The project works with
cabal repl
andcabal run :starman