
Hi Can anyone tell me how switch from using ghci to cabal repl in emacs with ghc-mod ? I would like to use emacs with cabal projects with sandboxes, where ghci will not load the right packages. best, -- Miguel Negrão http://www.friendlyvirus.org/miguelnegrao

On 18/03/14 11:53, Miguel Negrão wrote:
Hi
Can anyone tell me how switch from using ghci to cabal repl in emacs with ghc-mod ? I would like to use emacs with cabal projects with sandboxes, where ghci will not load the right packages.
best,
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
Personally I evaluate (setq haskell-program-name "cabal repl") . Make sure you are in the same directory as the cabal file when you first start up the REPL. If you get complaints about not being able to find prompt, check the *haskell* buffer that gets created in the background to see what's going wrong. -- Mateusz K.

Em 18-03-2014 18:47, Miguel Negrão escreveu: Following that, a couple more questions: Is it possible to have the haddock help for functions displayed inside emacs (no browser) ? How does one jump to the defition of a symbol ? thanks, Miguel

On 19/03/14 10:53, Miguel Negrão wrote:
Em 18-03-2014 18:47, Miguel Negrão escreveu:
Following that, a couple more questions:
Is it possible to have the haddock help for functions displayed inside emacs (no browser) ?
Not that I know of. GHCi doesn't support it (yet, maybe it will in the future) and Haskell interface files don't store this information so various tools can't get at it. I'm not aware of any tools that read the Haddock interface files and give you the docs that way. If someone/myself decides to go through with putting the Haddock strings into .hi files, reading documentation in your editor might become possible but I wouldn't hold my breath as it is completely in the ‘it'd be cool if we had this’ stage.
How does one jump to the defition of a symbol ?
I use hasktags to generate the TAGS table and then use find-tag (bound to M-.) to jump to things. It works fine but it does tend to screw up sometimes. Of course it will only work if your definition is in the generated table, it won't do things like jumping to definitions in the libraries you use etc. I imagine that you could have a massive TAGS table generated from all your sources but I doubt it'd scale very well and would be close to impossible to maintain. It'd be great if we had something like Agda, where all the source is available so we can jump to anything at all, but we don't.
thanks, Miguel
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
-- Mateusz K.

On 19/03/14 12:22, Mateusz Kowalczyk wrote:
On 19/03/14 10:53, Miguel Negrão wrote:
Em 18-03-2014 18:47, Miguel Negrão escreveu:
Following that, a couple more questions:
Is it possible to have the haddock help for functions displayed inside emacs (no browser) ?
Not that I know of. GHCi doesn't support it (yet, maybe it will in the future) and Haskell interface files don't store this information so various tools can't get at it. I'm not aware of any tools that read the Haddock interface files and give you the docs that way. If someone/myself decides to go through with putting the Haddock strings into .hi files, reading documentation in your editor might become possible but I wouldn't hold my breath as it is completely in the ‘it'd be cool if we had this’ stage.
As a quick follow-up, it might be that Haddock itself will provide an interface to its own interface files and then various tools (and GHCi) can use that instead. Again, just ideas atm.
How does one jump to the defition of a symbol ?
I use hasktags to generate the TAGS table and then use find-tag (bound to M-.) to jump to things. It works fine but it does tend to screw up sometimes. Of course it will only work if your definition is in the generated table, it won't do things like jumping to definitions in the libraries you use etc. I imagine that you could have a massive TAGS table generated from all your sources but I doubt it'd scale very well and would be close to impossible to maintain.
It'd be great if we had something like Agda, where all the source is available so we can jump to anything at all, but we don't.
thanks, Miguel
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
-- Mateusz K.

Hi Mateus, Em 19-03-2014 12:38, Mateusz Kowalczyk escreveu:
On 19/03/14 12:22, Mateusz Kowalczyk wrote:
On 19/03/14 10:53, Miguel Negrão wrote:
Em 18-03-2014 18:47, Miguel Negrão escreveu:
Following that, a couple more questions:
Is it possible to have the haddock help for functions displayed inside emacs (no browser) ?
Not that I know of. GHCi doesn't support it (yet, maybe it will in the future) and Haskell interface files don't store this information so various tools can't get at it. I'm not aware of any tools that read the Haddock interface files and give you the docs that way. If someone/myself decides to go through with putting the Haddock strings into .hi files, reading documentation in your editor might become possible but I wouldn't hold my breath as it is completely in the ‘it'd be cool if we had this’ stage.
As a quick follow-up, it might be that Haddock itself will provide an interface to its own interface files and then various tools (and GHCi) can use that instead. Again, just ideas atm.
How does one jump to the defition of a symbol ?
I use hasktags to generate the TAGS table and then use find-tag (bound to M-.) to jump to things. It works fine but it does tend to screw up sometimes. Of course it will only work if your definition is in the generated table, it won't do things like jumping to definitions in the libraries you use etc. I imagine that you could have a massive TAGS table generated from all your sources but I doubt it'd scale very well and would be close to impossible to maintain.
It'd be great if we had something like Agda, where all the source is available so we can jump to anything at all, but we don't.
Actually I found something that does this: haskdogs (http://hackage.haskell.org/package/haskdogs-0.1). It will create tags for all the imports, it's quite fast. This kind of also solves my first question, since when navigating to the source of a function usually the documentation is on a comment over the source. I gave a try to ergoemacs, since I ctrl-c ctrl-v is in my muscle memory for some 15 years already, but it conflicts with ghc-mods shortcuts. Anyone has experience with ergoemacs-mode and ghc-mod ? best, Miguel
participants (2)
-
Mateusz Kowalczyk
-
Miguel Negrão