Open PierreVieira opened 3 years ago
Same problem...
Hello all! @PierreVieira @FelipeSanchezCalzada (and folks who made reactions: @Yochyo, @senior-zero)
I guess it can be helpful for you and future searchers (like me before) as well
Had the same error but after that, I re-read the README and got a thing: to start working we need to open an already created project; not to create a fresh one
stack
(https://get.haskellstack.org/stable/windows-x86_64-installer.exe)PATH
env variablehelloworld
:
stack new helloworld new-template
helloworld
directory via IntelliJ IDEAHello all! @PierreVieira @PierreVieira (and folks who made reactions: @Yochyo, @senior-zero)
I guess it can be helpful for you and future searchers (like me before) as well
Had the same error but after that, I re-read the README and got a thing: to start working we need to open an already created project; not to create a fresh one
Steps
- Install
stack
(https://get.haskellstack.org/stable/windows-x86_64-installer.exe)- Reopen a terminal application to load updated
PATH
env variable- In your working directory, execute to create a project
helloworld
:stack new helloworld new-template
- Now we be able to open
helloworld
directory via IntelliJ IDEA- Wait for background tasks to finish
- Done! We can start our immersion in the wonderful world of functional programming
Demo
It seems to me that the project started successfully on IntelliJ. Although I get some error messages like: REPL couldn't be started for target "helloworld:test:helloworld-test" due to: cannot satisfy -package helloworld-0.1.0.0
Could you let me know if there is any easy way to run Main.hs
(created by the instruction steps you provided), present in helloworld/app
by IntelliJ?
Sorry for my late response.
@s373r Thanks for your help!
Looking to screenshot number 5, the project location should be including the project folder.
It seems to me that the project started successfully on IntelliJ. Although I get some error messages like: REPL couldn't be started for target "helloworld:test:helloworld-test" due to: cannot satisfy -package helloworld-0.1.0.0 Could you let me know if there is any easy way to run Main.hs (created by the instruction steps you provided), present in helloworld/app by IntelliJ?
@PierreVieira, I think we have several options[^1] here:
stack new run-demo simple
# ^^^^^^
# "simple" template is a bit lighter than the one used before ("new-template")
Open the previously created project in IntelliJ IDEA
much faster
on Windows[^2]
The commands here and below can be executed through the built-in terminal (Alt + F12
) directly from the IDE
stack runghc -- .\src\Main.hs
faster
):
stack run
To create the action we need (images below are clickable)
Internally that give us a command (slower
) but in this case, we have Run action (aka play button or Shift+F10
shortcut on default keymap):
stack build --exec run-demo
much faster
, faster
& slower
markers depend on my hardware -- you can get other results. I recommend make experiments with all of them and chouse more comfortable one
https://www.fpcomplete.com/haskell/tutorial/stack-script/ https://stackoverflow.com/questions/34842333/is-there-a-stack-run-similar-to-cabal-run https://hackage.haskell.org/package/stack-run
[^1]: I'm pretty new to Haskell developer tools, so any feedback is welcome! [^2]: For studying/quick changes, that looks good from a time perspective [^3]: Just run if no changes in source code
I'm doing the following step by step:
1)
2)
3)
4)
5)
But I'm getting this error:
My setup: