emacs haskell-mode with cabal exec, test suite sections

I'm having trouble coding test-suite and executable sections with the emacs REPL and flycheck. 1. cabal-repl can compile against the library code, but fails to see any modules within the non-library section. 2. flycheck has the opposite problem: it fails on library module imports but recognizes imports local to the section. Note I don't always have these issues, but they seem to crop up whenever I upgrade GHC, or emacs, or haskell-mode, flycheck-haskell etc. I'm not sure #1 ever works, but #2 is happening to me on my mac, but not at work on Linux. For #1, in the past I've tried a big .dir-locals.el to use `ghci` for the repl and just import everything -- of course losing the nice cabal integration, plus it being slow as molasses to load source files. I also briefly investigated modifying haskell-mode to support separate sessions for a given section. For #2, flycheck is just a pain to debug, my only recourse is to stick debug output into `flycheck-start-command-checker` to see what commands are going out, and try to troubleshoot. Any thoughts or suggestions? Commiseration is OK too :) Thanks, Stuart

On 7 September 2015 at 06:58, Stuart Popejoy
I'm having trouble coding test-suite and executable sections with the emacs REPL and flycheck.
1. cabal-repl can compile against the library code, but fails to see any modules within the non-library section.
haskell-session-change-target
2. flycheck has the opposite problem: it fails on library module imports but recognizes imports local to the section.
Yeah, it claims to have sandbox support but for some reason I've never managed to get it to stop complaining about not being able to find modules installed in the sandbox.
Note I don't always have these issues, but they seem to crop up whenever I upgrade GHC, or emacs, or haskell-mode, flycheck-haskell etc. I'm not sure #1 ever works, but #2 is happening to me on my mac, but not at work on Linux.
For #1, in the past I've tried a big .dir-locals.el to use `ghci` for the repl and just import everything -- of course losing the nice cabal integration, plus it being slow as molasses to load source files.
I also briefly investigated modifying haskell-mode to support separate sessions for a given section.
For #2, flycheck is just a pain to debug, my only recourse is to stick debug output into `flycheck-start-command-checker` to see what commands are going out, and try to troubleshoot.
Any thoughts or suggestions? Commiseration is OK too :)
Thanks, Stuart _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com http://IvanMiljenovic.wordpress.com

Am 07.09.2015 um 00:01 schrieb Ivan Lazar Miljenovic
: On 7 September 2015 at 06:58, Stuart Popejoy
wrote: I'm having trouble coding test-suite and executable sections with the emacs REPL and flycheck.
1. cabal-repl can compile against the library code, but fails to see any modules within the non-library section.
haskell-session-change-target
2. flycheck has the opposite problem: it fails on library module imports but recognizes imports local to the section.
Yeah, it claims to have sandbox support but for some reason I've never managed to get it to stop complaining about not being able to find modules installed in the sandbox.
Flycheck does not support Cabal sandboxes out of the box. You need to install and configure the addon package "flycheck-haskell".

On 9 September 2015 at 03:27, Sebastian Wiesner
Am 07.09.2015 um 00:01 schrieb Ivan Lazar Miljenovic
: Yeah, it claims to have sandbox support but for some reason I've never managed to get it to stop complaining about not being able to find modules installed in the sandbox. Flycheck does not support Cabal sandboxes out of the box. You need to install and configure the addon package "flycheck-haskell".
I have that, but still keep getting "module not found" flycheck errors now and then. -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com http://IvanMiljenovic.wordpress.com

Am 09.09.2015 um 00:10 schrieb Ivan Lazar Miljenovic
: On 9 September 2015 at 03:27, Sebastian Wiesner
wrote: Am 07.09.2015 um 00:01 schrieb Ivan Lazar Miljenovic
: Yeah, it claims to have sandbox support but for some reason I've never managed to get it to stop complaining about not being able to find modules installed in the sandbox. Flycheck does not support Cabal sandboxes out of the box. You need to install and configure the addon package "flycheck-haskell".
I have that, but still keep getting "module not found" flycheck errors now and then.
I might be able to help, but I'd need more information. Would you mind to show your Flycheck-related Emacs configuration?
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com http://IvanMiljenovic.wordpress.com

Am 06.09.2015 um 22:58 schrieb Stuart Popejoy
: I'm having trouble coding test-suite and executable sections with the emacs REPL and flycheck.
1. cabal-repl can compile against the library code, but fails to see any modules within the non-library section.
2. flycheck has the opposite problem: it fails on library module imports but recognizes imports local to the section.
Note I don't always have these issues, but they seem to crop up whenever I upgrade GHC, or emacs, or haskell-mode, flycheck-haskell etc. I'm not sure #1 ever works, but #2 is happening to me on my mac, but not at work on Linux.
For #1, in the past I've tried a big .dir-locals.el to use `ghci` for the repl and just import everything -- of course losing the nice cabal integration, plus it being slow as molasses to load source files.
I also briefly investigated modifying haskell-mode to support separate sessions for a given section.
For #2, flycheck is just a pain to debug, my only recourse is to stick debug output into `flycheck-start-command-checker` to see what commands are going out, and try to troubleshoot.
Do you know about `C-c ! C-c`/`M-x flycheck-compile`? This shows the command that Flycheck would use and the output it produces. Can you show your Flycheck/Haskell setup for Emacs, and try to provide more specific details about the errors you see? At best, please include the output of the above command. Greetings, Sebastian
participants (3)
-
Ivan Lazar Miljenovic
-
Sebastian Wiesner
-
Stuart Popejoy