Haskell mode for Emacs question

I have a silly problem. I'm using Emacs with the Haskell mode extension on Windows I have a source file in say c:/foo/src/main.hs main.hs is importing some other modules in that same src directory When I invoke GHCi from within Emacs, the first thing it does is :cd c:/foo and then :load "src/main.hs" But of course GHCi won't find the imported modules now, since the current directory is wrong. If I type in GHCi :cd src :load "main.hs" then it compiles fine. Does anyone have an idea why Emacs or the Haskell mode is switching to the parent directory of src instead of src itself, and how to fix this? Thanks a lot, Peter

Interesting. I have a similar, but worse problem. For me, ':load'ing main.hs
would fail to find the imported files. The only thing I appear to be able to
:load is files that don't import from local directories.
2009/1/22 Peter Verswyvelen
I have a silly problem. I'm using Emacs with the Haskell mode extension on Windows
I have a source file in say
c:/foo/src/main.hs
main.hs is importing some other modules in that same src directory
When I invoke GHCi from within Emacs, the first thing it does is
:cd c:/foo
and then
:load "src/main.hs"
But of course GHCi won't find the imported modules now, since the current directory is wrong.
If I type in GHCi
:cd src :load "main.hs"
then it compiles fine.
Does anyone have an idea why Emacs or the Haskell mode is switching to the parent directory of src instead of src itself, and how to fix this?
Thanks a lot, Peter
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On my Mac I've had the same problem. Commenting out lines (unless (equal default-directory root) (setq default-directory root) (inferior-haskell-send-command proc (concat ":cd " default-directory))) solved it for me. On 22 Jan 2009, at 20:23, Andrew Wagner wrote:
Interesting. I have a similar, but worse problem. For me, ':load'ing main.hs would fail to find the imported files. The only thing I appear to be able to :load is files that don't import from local directories.
2009/1/22 Peter Verswyvelen
I have a silly problem. I'm using Emacs with the Haskell mode extension on Windows
I have a source file in say
c:/foo/src/main.hs
main.hs is importing some other modules in that same src directory
When I invoke GHCi from within Emacs, the first thing it does is
:cd c:/foo
and then
:load "src/main.hs"
But of course GHCi won't find the imported modules now, since the current directory is wrong.
If I type in GHCi
:cd src :load "main.hs"
then it compiles fine.
Does anyone have an idea why Emacs or the Haskell mode is switching to the parent directory of src instead of src itself, and how to fix this?
Thanks a lot, Peter
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

indeed, that works! the comment above those lines is:
";; Not sure if it's useful/needed and if it actually works."
:-)
On Thu, Jan 22, 2009 at 6:41 PM, Miguel Mitrofanov
On my Mac I've had the same problem. Commenting out lines
(unless (equal default-directory root) (setq default-directory root) (inferior-haskell-send-command proc (concat ":cd " default-directory)))
solved it for me.
On 22 Jan 2009, at 20:23, Andrew Wagner wrote:
Interesting. I have a similar, but worse problem. For me, ':load'ing
main.hs would fail to find the imported files. The only thing I appear to be able to :load is files that don't import from local directories.
2009/1/22 Peter Verswyvelen
I have a silly problem. I'm using Emacs with the Haskell mode extension on Windows
I have a source file in say
c:/foo/src/main.hs
main.hs is importing some other modules in that same src directory
When I invoke GHCi from within Emacs, the first thing it does is
:cd c:/foo
and then
:load "src/main.hs"
But of course GHCi won't find the imported modules now, since the current directory is wrong.
If I type in GHCi
:cd src :load "main.hs"
then it compiles fine.
Does anyone have an idea why Emacs or the Haskell mode is switching to the parent directory of src instead of src itself, and how to fix this?
Thanks a lot, Peter
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Hmm, strange. This doesn't appear to fix my problem. Perhaps I have
something bigger broken locally :(
On Thu, Jan 22, 2009 at 12:44 PM, Peter Verswyvelen
indeed, that works! the comment above those lines is: ";; Not sure if it's useful/needed and if it actually works."
:-)
On Thu, Jan 22, 2009 at 6:41 PM, Miguel Mitrofanov
wrote: On my Mac I've had the same problem. Commenting out lines
(unless (equal default-directory root) (setq default-directory root) (inferior-haskell-send-command proc (concat ":cd " default-directory)))
solved it for me.
On 22 Jan 2009, at 20:23, Andrew Wagner wrote:
Interesting. I have a similar, but worse problem. For me, ':load'ing
main.hs would fail to find the imported files. The only thing I appear to be able to :load is files that don't import from local directories.
2009/1/22 Peter Verswyvelen
I have a silly problem. I'm using Emacs with the Haskell mode extension on Windows
I have a source file in say
c:/foo/src/main.hs
main.hs is importing some other modules in that same src directory
When I invoke GHCi from within Emacs, the first thing it does is
:cd c:/foo
and then
:load "src/main.hs"
But of course GHCi won't find the imported modules now, since the current directory is wrong.
If I type in GHCi
:cd src :load "main.hs"
then it compiles fine.
Does anyone have an idea why Emacs or the Haskell mode is switching to the parent directory of src instead of src itself, and how to fix this?
Thanks a lot, Peter
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

After emacs started your GHCi session, when you manually type
:cd "the full path of the directory of your Main.hs"
:load "Main.hs"
Does it work then?
Can you use GHCi from outside Emacs?
On Fri, Jan 23, 2009 at 1:09 AM, Andrew Wagner
Hmm, strange. This doesn't appear to fix my problem. Perhaps I have something bigger broken locally :(
On Thu, Jan 22, 2009 at 12:44 PM, Peter Verswyvelen
wrote: indeed, that works! the comment above those lines is: ";; Not sure if it's useful/needed and if it actually works."
:-)
On Thu, Jan 22, 2009 at 6:41 PM, Miguel Mitrofanov
wrote:
On my Mac I've had the same problem. Commenting out lines
(unless (equal default-directory root) (setq default-directory root) (inferior-haskell-send-command proc (concat ":cd " default-directory)))
solved it for me.
On 22 Jan 2009, at 20:23, Andrew Wagner wrote:
Interesting. I have a similar, but worse problem. For me, ':load'ing
main.hs would fail to find the imported files. The only thing I appear to be able to :load is files that don't import from local directories.
2009/1/22 Peter Verswyvelen
I have a silly problem. I'm using Emacs with the Haskell mode extension on Windows
I have a source file in say
c:/foo/src/main.hs
main.hs is importing some other modules in that same src directory
When I invoke GHCi from within Emacs, the first thing it does is
:cd c:/foo
and then
:load "src/main.hs"
But of course GHCi won't find the imported modules now, since the current directory is wrong.
If I type in GHCi
:cd src :load "main.hs"
then it compiles fine.
Does anyone have an idea why Emacs or the Haskell mode is switching to the parent directory of src instead of src itself, and how to fix this?
Thanks a lot, Peter
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

mmm, it seems that the code is searching for the location of a cabal file
and uses that as the current directory, assuming all source code is relative
to that directory, instead of using the source directive in that cabal file.
On Thu, Jan 22, 2009 at 6:23 PM, Andrew Wagner
Interesting. I have a similar, but worse problem. For me, ':load'ing main.hs would fail to find the imported files. The only thing I appear to be able to :load is files that don't import from local directories.
2009/1/22 Peter Verswyvelen
I have a silly problem. I'm using Emacs with the Haskell mode extension on Windows
I have a source file in say
c:/foo/src/main.hs
main.hs is importing some other modules in that same src directory
When I invoke GHCi from within Emacs, the first thing it does is
:cd c:/foo
and then
:load "src/main.hs"
But of course GHCi won't find the imported modules now, since the current directory is wrong.
If I type in GHCi
:cd src :load "main.hs"
then it compiles fine.
Does anyone have an idea why Emacs or the Haskell mode is switching to the parent directory of src instead of src itself, and how to fix this?
Thanks a lot, Peter
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Oops, sorry, forgot to mention that lines worth commenting were in "inf-haskell.el" file. On 22 Jan 2009, at 20:23, Andrew Wagner wrote:
Interesting. I have a similar, but worse problem. For me, ':load'ing main.hs would fail to find the imported files. The only thing I appear to be able to :load is files that don't import from local directories.
2009/1/22 Peter Verswyvelen
I have a silly problem. I'm using Emacs with the Haskell mode extension on Windows
I have a source file in say
c:/foo/src/main.hs
main.hs is importing some other modules in that same src directory
When I invoke GHCi from within Emacs, the first thing it does is
:cd c:/foo
and then
:load "src/main.hs"
But of course GHCi won't find the imported modules now, since the current directory is wrong.
If I type in GHCi
:cd src :load "main.hs"
then it compiles fine.
Does anyone have an idea why Emacs or the Haskell mode is switching to the parent directory of src instead of src itself, and how to fix this?
Thanks a lot, Peter
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Not that you're looking to switch editors, but if you want something a little more hassle-free: http://www.n-brain.net/unashots/Haskell/ErrorHighlighting.png Regards, John On Jan 22, 2009, at 10:17 AM, Peter Verswyvelen wrote:
I have a silly problem.
I'm using Emacs with the Haskell mode extension on Windows
I have a source file in say
c:/foo/src/main.hs
main.hs is importing some other modules in that same src directory
When I invoke GHCi from within Emacs, the first thing it does is
:cd c:/foo
and then
:load "src/main.hs"
But of course GHCi won't find the imported modules now, since the current directory is wrong.
If I type in GHCi
:cd src :load "main.hs"
then it compiles fine.
Does anyone have an idea why Emacs or the Haskell mode is switching to the parent directory of src instead of src itself, and how to fix this?
Thanks a lot, Peter
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Hello John, Thursday, January 22, 2009, 8:50:39 PM, you wrote: thanks, support of over-internet and intranet collaboration looks very promising these days (even if not saying about ability to highlight error place ;) btw, i was unable to download mp4 video from http://vimeo.com/1653402 (online players doesn't work in my browser)
Not that you're looking to switch editors, but if you want something a little more hassle-free:
http://www.n-brain.net/unashots/Haskell/ErrorHighlighting.png
Regards,
John
On Jan 22, 2009, at 10:17 AM, Peter Verswyvelen wrote:
I have a silly problem.
I'm using Emacs with the Haskell mode extension on Windows
I have a source file in say
c:/foo/src/main.hs
main.hs is importing some other modules in that same src directory
When I invoke GHCi from within Emacs, the first thing it does is
:cd c:/foo
and then
:load "src/main.hs"
But of course GHCi won't find the imported modules now, since the current directory is wrong.
If I type in GHCi
:cd src :load "main.hs"
then it compiles fine.
Does anyone have an idea why Emacs or the Haskell mode is switching to the parent directory of src instead of src itself, and how to fix this?
Thanks a lot, Peter
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

http://depositfiles.com/files/4565hs7vl On 22 Jan 2009, at 21:14, Bulat Ziganshin wrote:
Hello John,
Thursday, January 22, 2009, 8:50:39 PM, you wrote:
thanks, support of over-internet and intranet collaboration looks very promising these days (even if not saying about ability to highlight error place ;)
btw, i was unable to download mp4 video from http://vimeo.com/1653402 (online players doesn't work in my browser)
Not that you're looking to switch editors, but if you want something a little more hassle-free:
http://www.n-brain.net/unashots/Haskell/ErrorHighlighting.png
Regards,
John
On Jan 22, 2009, at 10:17 AM, Peter Verswyvelen wrote:
I have a silly problem.
I'm using Emacs with the Haskell mode extension on Windows
I have a source file in say
c:/foo/src/main.hs
main.hs is importing some other modules in that same src directory
When I invoke GHCi from within Emacs, the first thing it does is
:cd c:/foo
and then
:load "src/main.hs"
But of course GHCi won't find the imported modules now, since the current directory is wrong.
If I type in GHCi
:cd src :load "main.hs"
then it compiles fine.
Does anyone have an idea why Emacs or the Haskell mode is switching to the parent directory of src instead of src itself, and how to fix this?
Thanks a lot, Peter
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

It's too bad Visual Haskell was not continued, since a free version of the
Visual Studio platform is available now.
I felt Visual Haskell was very promising, like on the fly type inference
with tool tips, code completion, built in Cabal support, etc...
On Thu, Jan 22, 2009 at 6:50 PM, John A. De Goes
Not that you're looking to switch editors, but if you want something a little more hassle-free:
http://www.n-brain.net/unashots/Haskell/ErrorHighlighting.png
Regards,
John
On Jan 22, 2009, at 10:17 AM, Peter Verswyvelen wrote:
I have a silly problem.
I'm using Emacs with the Haskell mode extension on Windows
I have a source file in say
c:/foo/src/main.hs
main.hs is importing some other modules in that same src directory
When I invoke GHCi from within Emacs, the first thing it does is
:cd c:/foo
and then
:load "src/main.hs"
But of course GHCi won't find the imported modules now, since the current directory is wrong.
If I type in GHCi
:cd src :load "main.hs"
then it compiles fine.
Does anyone have an idea why Emacs or the Haskell mode is switching to the parent directory of src instead of src itself, and how to fix this?
Thanks a lot, Peter
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

looks like a neath editor. too bad on windows you don't get anti aliased
fonts (I guess it uses an old J2SE or something?)
at first sight I was not able to find Haskell support in the freely
downloadable version. is this available in the commercial version?
On Thu, Jan 22, 2009 at 6:50 PM, John A. De Goes
Not that you're looking to switch editors, but if you want something a little more hassle-free:
http://www.n-brain.net/unashots/Haskell/ErrorHighlighting.png
Regards,
John
On Jan 22, 2009, at 10:17 AM, Peter Verswyvelen wrote:
I have a silly problem.
I'm using Emacs with the Haskell mode extension on Windows
I have a source file in say
c:/foo/src/main.hs
main.hs is importing some other modules in that same src directory
When I invoke GHCi from within Emacs, the first thing it does is
:cd c:/foo
and then
:load "src/main.hs"
But of course GHCi won't find the imported modules now, since the current directory is wrong.
If I type in GHCi
:cd src :load "main.hs"
then it compiles fine.
Does anyone have an idea why Emacs or the Haskell mode is switching to the parent directory of src instead of src itself, and how to fix this?
Thanks a lot, Peter
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

No, Haskell support in the free version too. However, you'll have to add the tools to compile .hs files in the "Tools" menu. You can pipe the output to directly highlight errors/warnings in the document (which is what's done in the screenshot below), because the editor understands what GHC errors/warnings look like. Regards, John http://www.n-brain.net | 877-376-2724 x 101 On Jan 23, 2009, at 10:45 AM, Peter Verswyvelen wrote:
looks like a neath editor. too bad on windows you don't get anti aliased fonts (I guess it uses an old J2SE or something?)
at first sight I was not able to find Haskell support in the freely downloadable version. is this available in the commercial version?
On Thu, Jan 22, 2009 at 6:50 PM, John A. De Goes
wrote: Not that you're looking to switch editors, but if you want something a little more hassle-free:
http://www.n-brain.net/unashots/Haskell/ErrorHighlighting.png
Regards,
John
On Jan 22, 2009, at 10:17 AM, Peter Verswyvelen wrote:
I have a silly problem.
I'm using Emacs with the Haskell mode extension on Windows
I have a source file in say
c:/foo/src/main.hs
main.hs is importing some other modules in that same src directory
When I invoke GHCi from within Emacs, the first thing it does is
:cd c:/foo
and then
:load "src/main.hs"
But of course GHCi won't find the imported modules now, since the current directory is wrong.
If I type in GHCi
:cd src :load "main.hs"
then it compiles fine.
Does anyone have an idea why Emacs or the Haskell mode is switching to the parent directory of src instead of src itself, and how to fix this?
Thanks a lot, Peter
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (5)
-
Andrew Wagner
-
Bulat Ziganshin
-
John A. De Goes
-
Miguel Mitrofanov
-
Peter Verswyvelen