Autocomplete not working correctly after updating Cabal - haskell

I recently updated Cabal to version 1.22, before installing ghc-mod so I could get some much needed error-checking in my projects.
The update didn't come without complications, ghc-mod wouldn't even run before I had added the path of the latest version of Cabal to $PATH. Upon doing so, haskell-mode started acting up, as loading the interpreter no longer greeted me with the familiar phrase "Your command is my IO", but instead appeared to be the standard GHCI. Not only that, but it didn't ask if I wanted to start a new project named haskell like it usually did prior to the change; and with that, all the glorious autocompletion was gone.
After a bit of fiddling around I learned that Emacs had trouble loading haskell-interactive-mode, being told it had something to do with haskell-mode itself, I installed it anew, and added
(require 'haskell-mode)
(add-hook 'haskell-mode-hook 'interactive-haskell-mode)
(eval-after-load "auto-complete"
'(add-to-list 'ac-modes 'haskell-interactive-mode))
to my .emacs file, and suddenly the error was gone, however the problem persists, and now whenever I try loading the interpreter, Emacs will ask me to provide a path to Cabal, then the current working directoryl; after which I'll be greeted by the repl that used to enable the autocompletion.
Except... it still doesn't autocomplete. Or rather, it autocompletes whatever's in the document, but it doesn't reveal functions as I type, it doesn't show me sub-modules like it used to, it doesn't do anything at all, except auto-generate type signatures when I press C-u C-c C-t.
I really have no idea how to go by from here, and would really appreciate some help.

Related

Vim(spf13) auto debug when save

Vim "spf13" offer a plug-in that when you try to save the file in vim (:w), it will show all compile error on left(by red arrow). For example, when I open a ".cc" file and try to save it(:w), the vim will show all error information same as when you "g++" it. but some of my code use c++14 style(e.g.: shared_ptr). So I want change the default compiler of this plug-in to g++ -std=c++14. (I don't know the plug-in name), so what should I do?
From what I could find, spf13 is basically just vim preconfigured with other plugins that exist already. So your real question isn't about spf13, but the syntax checking plugin that it uses, which appears to be Syntastic. For a quick fix let g:syntastic_cpp_compiler_options = ' -std=c++14' should probably do the trick. I would recommend looking more into syntastic's settings so you can configure it on a per-project basis with .syntastic files.
If you are feeling a little more ambitious to break out of the plugins spf13 comes pre-configured with, I have become a fan of ALE: The Asyncronous Lint Engine which makes use of Vim8's jobs to lint in the background instead of freezing while it lints.

installing EclipseFP fails on the URL

In my studies I was required to learn Haskell by myself, and to code in Haskell. I searched a lot about how to install plugins for Haskell, and I saw that it can be done on Eclipse development environment, version 3.7 or later. I downloaded this from here: http://filehippo.com/download_eclipse_classic_64/tech/11757/ (if you will go to this site it will be downloaded to your computer immediately!).
I followed up, step by step, after the installation-instructions, which I found here:
http://eclipsefp.github.io/install.html
I added the plugin's URL that was given there, and everything was fine.
But then, when I tried to start using EclipseFP by going to Window > Open perspective > Other... and selecting Haskell - I got the following error:
"problems opening perspective 'net.sf.eclipsefp.haskell.ui.HaskellPespective'".
And that it. I actually cannot using EclipseFP...
Does anyone have a solution?
please!
P.S. I also tried installing Haskell on intellij, as someone explained here, but it didn't work either. I didn't knew how to actually open a Haskell program.
Thanks again!
EclipseFP is no longer an active project, so you'll struggle to get support. Most people who use Haskell use emacs or vim. You'll probably find Atom easier to get started with though. Atom with the following packages works for me:
autocomplete-haskell
haskell-ghc-mod
haskell-hoogle
ide-haskell (this is the main package)
ide-haskell-cabal
ide-haskell-repl
language-haskell
As GarethR says, EclipseFP is no longer active. You might also look at Leksah, which is purpose-written in Haskell for Haskell.

Syntax Coloring for Haskell?

I started using Haskell today and am following the tutorial through learnyouahaskell.com. However, in the tutorial all of their syntax automatically gets colored in the terminal. I am using Command Prompt through ConEmu and was wondering if there was any way that I could also get this coloring (easily). I've been looking for downloads or suggestions online and couldn't find anything. I have Notepadd++ for when I want to make .hs files, but nothing for the terminal itself once I initialize ghci.
I would suggest using Emacs with haskell-mode. I'm a Emacs fan, and I just started exploring Haskell too, haskell-mode works perfectly. I don't know if there is something like this for Notepad++.
Here is full list of editors that support Haskell highlighting. As for terminal colouring, I doubt that it will be easy on Windows (you're on windows, right?), you need an IDE.

Querying a module for a list of functions/types

I am new to haskell and I recently installed emacs with haskell-mode and I am wondering if it is somehow possible to query a namespace to get a list of functions/types?
For example if I do
import qualified Graphics.UI.GLFW as G
and then
G.
It would be nice to see what data is inside of G. Does something like this exist?
If you're in GHCi, you can use
> :browse Grahics.UI.GLFW
If otherwise, there's several modules out there than can perform this functionality. I don't know of any plugins specific to emacs, but in Sublime Text I use the SublimeHaskell plugin which uses ghc-mod, hdevtools, and a few other packages installable from cabal to provide that sort of functionality.
I do not program in haskell (but I do use emacs), a bit of googling lead to this page which has some tips for using emacs for haskell, which you may find it useful. Emacs frontend to ghc-mod might provide the feature you are looking for. Scion also looks interesting.

When I press the space bar in the Leksah source editor, nothing happens. What packages do I lack?

I'm going to retry learning Haskell again... So I apt-get installed leksah, ghc, quickcheck, and cabal-install. It didn't work right from the start, this is why I had to install cabal-install and quickcheck. But now the welcoming Main.hs Helloworld compiles fine, and runs fine. ( It's a really nice hand shake for beginners I must admit I appreciate )
However I'm facing some really strange problem. When I press the space bar in the Leksah source editor, nothing happens.
For example it won't let me enter type MyType = Int I would be stuck at the end of the word type... and if I continue the letters after the space, it would happend MyType to type giving me: typeMyType
If I define a function, it's not possible to insert any space in between elements
test_swap::[a]->[a]
test_swap(w1:w2:ws)=w2:w1:ws
test_swap(ws)=ws
I suspect that I am missing some package to install. I'm using Ubuntu 12.04, with fluxbox, I have multiple keybindings but all other applications lives with it well and currently I use my space bar between each word in chromium. I have read that the Leksah editor uses gtk, but ubuntu unity uses parts of gtk/gnome so I should have gtk ok... but maybe I am missing a tiny bit...
I don't know. How could I know/guess what I am missing ?
This is a Gtk-related problem that occurs only for specific keyboard layouts. It happens with other applications such as Rhythmbox or Codeblocks.
In Ubuntu, you can fix this by switching the default keyboard layout "French (alternative)" to "French (France)" (see this bug report: https://bugs.launchpad.net/ubuntu/+source/hal/+bug/451258).
Alternatively, you can add this option to your keyboard map:
setxkbmap -option nbsp:none

Resources