These are chat archives for carymrobbins/intellij-haskforce

18th
Dec 2018
Cary Robbins
@carymrobbins
Dec 18 2018 15:09
@allmycode_twitter ^^
Barry Burd
@allmycode_twitter
Dec 18 2018 16:25
alt
alt
alt
Oops! Checking that Haskell SDK home path ... (?)
Cary Robbins
@carymrobbins
Dec 18 2018 17:05
Ignore the Haskell SDK home path, it's mostly unused and required for some internal intellij stuff
but the path itself doesn't get used
i notice that your project doesn't have a stack.yaml
also, the Haskell Stack Run is for running your compiled binary, not for running ghc
@allmycode_twitter ^
be sure to create the project with the project wizard and select Build with Stack
Barry Burd
@allmycode_twitter
Dec 18 2018 17:27
I'm pretty sure that I selected Build with Stack. I'll double check.
Cary Robbins
@carymrobbins
Dec 18 2018 17:29
maybe there's something wrong with your stack setup
try to create a project from the command line with stack new
Barry Burd
@allmycode_twitter
Dec 18 2018 18:45
alt
When I create a project with "stack new" (on the left) I get a full project. When I create a project with IntelliJ (on the right) I get only a few files. I'll send screenshots to show you what I'm doing in IntelliJ, step by step.
Barry Burd
@allmycode_twitter
Dec 18 2018 18:52
alt
alt
alt
alt
alt
Cary Robbins
@carymrobbins
Dec 18 2018 18:54
haskforce should be using stack under the hood to take care of it, maybe there's some oddity going on with windows
Barry Burd
@allmycode_twitter
Dec 18 2018 18:57
Does HaskForce provide any interface to ghci?
I'll try the same thing again with my Mac.
Cary Robbins
@carymrobbins
Dec 18 2018 19:08
HaskForce doesn't provide an inteface to ghci; however, you can always get one by using intellij's built-in terminal and invoking ghci directly
also, if stack new works, you should be able to just import the project using HaskForce as well, just choose the Stack model when importing
Barry Burd
@allmycode_twitter
Dec 18 2018 19:14
I'm seeing the same behavior when I create a project in IntelliJ on the Mac so I must be doing something wrong on both computers. Here's what happens on the Mac when I try to create a new project on the command line:

new-host-10:HaskellProject barryburd$ stack new Project1
Downloading template "new-template" to create project "Project1" in Project1/ ...

The following parameters were needed by the template but not provided: author-email, author-name, category, copyright, github-username
You can provide them in /Users/barryburd/.stack/config.yaml, like this:
templates:
params:
author-email: value
author-name: value
category: value
copyright: value
github-username: value
Or you can pass each one as parameters like this:
stack new Project1 new-template -p "author-email:value" -p "author-name:value" -p "category:value" -p "copyright:value" -p "github-username:value"

Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:

  • Project1/Project1.cabal

Selecting the best among 14 snapshots...

Downloaded lts-12.24 build plan.
AesonException "Error in $.packages.cassava.constraints.flags: failed to parse field packages: failed to parse field constraints: failed to parse field flags: Invalid flag name: \"bytestring--lt-0_10_4\""
new-host-10:HaskellProject barryburd$ ls
Project1
new-host-10:HaskellProject barryburd$ cd Project1
new-host-10:Project1 barryburd$ ls
ChangeLog.md Project1.cabal Setup.hs package.yaml test
LICENSE README.md app src
new-host-10:Project1 barryburd$

Cary Robbins
@carymrobbins
Dec 18 2018 19:15
it might just be that it was the first time stack was set up and so it took too long or something
haskforce should give better feedback in that regard
Barry Burd
@allmycode_twitter
Dec 18 2018 19:15
new-host-10:Project1 barryburd$ ls
ChangeLog.md Project1.cabal Setup.hs package.yaml test
LICENSE README.md app
Cary Robbins
@carymrobbins
Dec 18 2018 19:15
so i'd recommend just creating the stack project on the command line and importing it into haskforce
since these will be mostly new folks using the tools
i could also look into improving the way the new project wizard works
for new systems
Reggie Perry
@reggieperry
Dec 18 2018 19:16
Question: Does haskforce support typed holes?
Cary Robbins
@carymrobbins
Dec 18 2018 19:16
(assuming that's the issue)
Barry Burd
@allmycode_twitter
Dec 18 2018 19:17
I still keep getting that AesonException "Error in $.packages.cassava.constraints.flags: on the command line on the Mac.
Cary Robbins
@carymrobbins
Dec 18 2018 19:17
@allmycode_twitter oh that seeems like some issue with stack
Barry Burd
@allmycode_twitter
Dec 18 2018 19:18
I'll try reinstalling stack on the Mac
Cary Robbins
@carymrobbins
Dec 18 2018 19:18
@allmycode_twitter this issue sounds familiar...may be worth a google
@reggieperry nothing stops you from using type holes, although i recently added parser support for them so they won't appear red in the IDE. that will be released soon.
Reggie Perry
@reggieperry
Dec 18 2018 19:24
The reason I ask is because typed holes with the new valid-hole-fits feature would be very powerful in IntelliJ to aid in type driven development. I would be curious as to how tough that would be to implement in haskforce.
Cary Robbins
@carymrobbins
Dec 18 2018 20:09
@reggieperry haskforce currently has ghc-mod integration, and i believe ghc-mod provides something like this (the refine command)
i'm not sure if this completely handles your use case, feel free to open a feature request on the haskforce issue tracker. i'll be able to add details there about what may be needed for implementing this
Cary Robbins
@carymrobbins
Dec 18 2018 20:19
oh and -frefinement-level-hole-fits looks interesting as well
Barry Burd
@allmycode_twitter
Dec 18 2018 20:25
@carymrobbins You said "the Haskell Stack Run is for running your compiled binary, not for running ghc" so I get "Executable named ... not found on path". I don't see any executable that's been created in any of the project directories.
Cary Robbins
@carymrobbins
Dec 18 2018 20:28
@allmycode_twitter Right, so first your build must succeed. Your binary name is defined in your cabal file (or package.yaml). The analogous workflow on the command line would be -
$ stack build
$ stack exec <compiled-executable-name-from-cabal-file>
if stack build fails, you can't exec the binary because it doesn't exist yet
Barry Burd
@allmycode_twitter
Dec 18 2018 20:30
I thought I already had a successful build after importing a project that I created on the command line, but I'll keep poking around.
Cary Robbins
@carymrobbins
Dec 18 2018 20:30
to debug this, what is the result of stack build from the command line?
Barry Burd
@allmycode_twitter
Dec 18 2018 20:33
stack build
[1 of 2] Compiling Main ( /Users/barryburd/.stack/setup-exe-src/setup-mPHDZzAJ.hs, /Users/barryburd/.stack/setup-exe-src/setup-mPHDZzAJ.o )
[2 of 2] Compiling StackSetupShim ( /Users/barryburd/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /Users/barryburd/.stack/setup-exe-src/setup-shim-mPHDZzAJ.o )
Linking /Users/barryburd/.stack/setup-exe-cache/x86_64-osx/tmp-Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.4 ...
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
Building all executables for `HaskForceCreatedWithStackCommand' once. After a successful build of all of them, only specified executables will be rebuilt.
HaskForceCreatedWithStackCommand-0.1.0.0: configure (lib + exe)
Configuring HaskForceCreatedWithStackCommand-0.1.0.0...
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
HaskForceCreatedWithStackCommand-0.1.0.0: build (lib + exe)
Preprocessing library for HaskForceCreatedWithStackCommand-0.1.0.0..
Building library for HaskForceCreatedWithStackCommand-0.1.0.0..
[1 of 2] Compiling Lib ( src/Lib.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Lib.o )
[2 of 2] Compiling Paths_HaskForceCreatedWithStackCommand ( .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/autogen/Paths_HaskForceCreatedWithStackCommand.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Paths_HaskForceCreatedWithStackCommand.o )
Preprocessing executable 'HaskForceCreatedWithStackCommand-exe' for HaskForceCreatedWithStackCommand-0.1.0.0..
Building executable 'HaskForceCreatedWithStackCommand-exe' for HaskForceCreatedWithStackCommand-0.1.0.0..
[1 of 2] Compiling Main ( app/Main.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/HaskForceCreatedWithStackCommand-exe/HaskForceCreatedWithStackCommand-exe-tmp/Main.o )
[2 of 2] Compiling Paths_HaskForceCreatedWithStackCommand ( .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/HaskForceCreatedWithStackCommand-exe/autogen/Paths_HaskForceCreatedWithStackCommand.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/HaskForceCreatedWithStackCommand-exe/HaskForceCreatedWithStackCommand-exe-tmp/Paths_HaskForceCreatedWithStackCommand.o )
Linking .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/HaskForceCreatedWithStackCommand-exe/HaskForceCreatedWithStackCommand-exe ...
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
HaskForceCreatedWithStackCommand-0.1.0.0: copy/register
Installing library in /Users/barryburd/IdeaProjects/HaskForceCreatedWithStackCommand/.stack-work/install/x86_64-osx/lts-12.24/8.4.4/lib/x86_64-osx-ghc-8.4.4/HaskForceCreatedWithStackCommand-0.1.0.0-FSht0SwUqhaBKIg0yZqz6G
Installing executable HaskForceCreatedWithStackCommand-exe in /Users/barryburd/IdeaProjects/HaskForceCreatedWithStackCommand/.stack-work/install/x86_64-osx/lts-12.24/8.4.4/bin
Registering library for HaskForceCreatedWithStackCommand-0.1.0.0..
new-host-10:HaskForceCreatedWithStackCommand barryburd$
Cary Robbins
@carymrobbins
Dec 18 2018 20:34
btw you can wrap the output in triple backticks to make it easier to read
like this
that said
Installing executable HaskForceCreatedWithStackCommand-exe in ...
so you want to run
stack exec HaskForceCreatedWithStackCommand-exe
Barry Burd
@allmycode_twitter
Dec 18 2018 20:35
OK. Got to go now but I'll try it (and I'll use backticks in the future where necessary). Thanks.
Cary Robbins
@carymrobbins
Dec 18 2018 20:36
sounds good. last thing - in haskforce the executable name is HaskForceCreatedWithStackCommand-exe
the name is defined in your cabal file
Reggie Perry
@reggieperry
Dec 18 2018 22:31
@carymrobbins Will do. Thanks.