8 ms·
Intero for Emacs: complete interactive development program for Haskell
- mark_l_watson 10y agoI saw this notice on Reddit early yesterday morning and ended up using Intero for most of the day. Love it! There are a lot of improvements over and above the Emacs Haskell mode. I really like how fast it is to control-c-l and be put n the correct module and be running in seconds. I also like the realtime syntax error hints, type information, etc.
- cm3 10y agoThere should be a warning that on first start of intero-mode, this will initiate a rather long stack operation, which I suppose is extra long if you hadn't used stack before. Also, it seems to insist on a stack'ised project. But I suppose one could say that should be obvious. I use cabal because stack misses some features and is a little weird and use stack when I have to. And even though I have intero installed and in $PATH, when opening an actual project with a stack file, it start building intero. Weird automatism.
- psibi 10y agoWhat features do you think stack misses ?
- cm3 10y ago* split-objects to create much smaller binaries. In cabal it's a single line in its global config file. * Using my already available GHC builds, because stack's GHC builds do not work everywhere, not even across all Linux distros. If I have a musl-based Linux distro, FreeBSD, or Solaris it'll be a problem. Also, there are many users who prefer to use other builds than those downloaded via stack. This happens even if there is already the right GHC in PATH by default. * I like cabal's new new-foo features and project file support. * Not bailing out if I open a random .hs file where there's no associated stack config. In a sibling comment Chris says he wants it to work automagically, but then it should create a global stack file, which he says will be used if available. * Offline mode. * I will find more stuff I miss, once I have used stack more.
- mark_l_watson 10y agoYou are correct about the initial first time build delay, and it is done for each separate project. After playing with Intero on one of my stack based projects, I took the background time effort to pre-build all of my projects while exercising. Then, there is no delay (until I start a new project). Stack has changed my development workflow, in a very positive way, and I love Intero (at least in the first 24 hours of use).
- chrisdone 10y agoThis was a trade-off I went with. One thing that I learned from years of hacking on haskell-mode is that adding an option for every little decision adds up to a brittle user-experience. If you want this, enable that. If you want to enable that, install this. And so on. A survey showed that most people used about 20% of the features available in haskell-mode. In the case of Intero I made every decision for the user; there are no customization options in the mode, and it leads to long (first-time) start-ups like this. But in the end I'd rather wait a minute and have every project always work reliably (and this isn't unheard-of for IDEs). It does build a version of intero for each project environment, because the GHC version and package set may differ. This is in contrast to e.g. ghc-mod or hdevtools which is locked to a specific GHC version, so switching between projects is not smooth.
- jesserosenthal 10y agoThis looks great! My only complaint is that sometimes I do want to work on a quick script outside of a stack environment, and this seems like an all-or-nothing proposition. (I use haskell for pandoc filters quite a bit, for example, and setting up stack for that seems like overkill.) I'm sure a bit of elisp could make it fall back to haskell mode if it can't find a local .stack dir.
- chrisdone 10y agoIf there's no stack.yaml it uses the global ~/.stack/global/stack.yaml. So you should be able to open any random file and it'll work out. E.g. if I open ~/X.hs and import Lucid, I can just run stack build lucid in my ~/ and now M-x intero-restart and it has access to that package.
- pash 10y agoI've been waiting for this release before finally trying to switch from Vim (MacVim) to Spacemacs. Anybody have any tips for somebody who's never really used Emacs?
- optimali 10y agoMap command key to caps lock. Setting (global-set-key (kbd "M-P") 'scroll-down-line) (global-set-key (kbd "M-N") 'scroll-up-line) Has also been indispensable for scrolling (though you may choose to do so differently, coming from vim).
- Steeeve 10y agoI forgot about that. Caps lock is useless 99% of the time and having that control available easily with your left pinky makes emacs (and everything else) work. I'm so confused when I get on other people's computers and caps lock is actually caps lock.
- mijoharas 10y agoSince he is looking at spacemacs, I'd recommend mapping caps lock to escape when it's tapped, but ctrl when it's pressed in conjunction with other keys. Very useful, (though I suffer from the same problem when on other peoples computers)
- Asooka 10y agoHear hear. Ctrl on caps lock changed my life. Then I bought a TECK^, which comes with a split spacebar and put left alt on caps (or where caps is usually, teck has control there) and right control on the right spacebar. This is honestly the best setup ever and I don't even use Emacs, I use Vim. ^ truly ergonomic computer keyboard. It's nice, but the hardware can be a bit wonky.
- kiliancs 10y agoMy experience was very straightforward. It's easy to configure for most scenarios if you follow the documentation and use any of its layers (see https://github.com/syl20bnr/spacemacs/tree/master/layers https://github.com/syl20bnr/spacemacs/tree/master/layers). Most Vim key bindings work beautifully. For be its best feature is how discoverable it is.
- seagreen 10y agoLooks like I've got a choice to make (all on NixOS): + Stick with NeoVim and hope one of the Intero ports to that editor takes off (as I understand it there are a couple right now) + Switch to Emacs+Evil+Intero. I've never used Emacs before (even with Evil) so it would be a little work. If someone more up-to-date on the situation has advice that would be awesome:)
- jonahx 10y agoI'd also be curious to know if there is any way to support vim plugins in evil mode.
- endgame 10y agoI don't know NixOS, but this blog post and lecture might help you give emacs a fair trial: http://blog.aaronbieber.com/2015/05/24/from-vim-to-emacs-in-fourteen-days.html http://blog.aaronbieber.com/2015/05/24/from-vim-to-emacs-in-... https://www.youtube.com/watch?v=JWD1Fpdd4Pc https://www.youtube.com/watch?v=JWD1Fpdd4Pc One of my vim-using coworkers found it. He, along with another colleague, have since found emacs compelling enough to use as their main text editor.
- seagreen 10y agoThanks, this is encouraging.
- akkartik 10y agoUnfortunately those instructions failed out of the gate at this command in .emacs: (require 'package) The error I get is: File error: "Cannot open load file", "package". I installed emacs on OS X using: $ brew install emacs But it looks like version 24.5 on OS X El Capitan doesn't come with something called 'package.el'. Oh well, back to Vim..
- ics 10y agoAre you sure that you launched the correct emacs? (`M-x version RET` in Emacs to check) This is an extremely common error for people using the built-in version which, as of El Capitan, is still Emacs 22.1 (almost 10 years old).
- avindroth 10y agoHaskell changed my life. Then Intero did it again.
- miguelrochefort 10y agoHow sad is it that people invest this amount of effort into things that essentially nobody will use?
- ams6110 10y agoWell I guess they use it, why does it matter what anyone else does?
- taeric 10y agoNot sad at all. I confess I have similar thoughts when I look at things that are getting reinvented all over the place. I have come to feel this is actually a counterproductive thought. Exploring in obscure tools is the definition of tinkering exploration. Which is often a big driver in pushing progress. (Same for reinvention.)
- iand675 10y agoI use it, so...
- mwotton 10y agoMe too. Got its quirks (I wish it noticed stack-relevant changes and ran intero-restart itself) but I find it really valuable, especially with Anthony Cowley's suggestion-handling stuff.
- gravypod 10y agoI wish I could get a similar utility for Python and Javascript as this seems to show off some cool FP auto complete. I'm basically looking for a way to remove my dependency on my 5-7 IDEs and I don't know how. I wish someone could show me a very good, simple, alternative to all of them. I work in C, Java, JavaScript, Python, PHP, and C# and I'd like to be able to use a single IDE solution for all of them. Sadly I cant find anything with good auto completion and nice features (like things offered by Eclipse). This has some really promising features, I've got to say I'm amazed.
- _asummers 10y agoHave you tried company mode? I personally just use hippie-expand, but my codebases aren't gigantic; unsure how it'd work on larger ones.
- mdadm 10y ago> Sadly I cant find anything with good auto completion and nice features (like things offered by Eclipse). Out of curiosity, have you tried the relevant JetBrains IDE(s)?
- wcummings 10y agoeclim is the best you're gunna do for Java in Emacs I think, and it's realllllllllly slow.
- 10y ago
- patrec 10y agoVery nice! But is there currently no way to get any information about third party code other than the type signature (C-c C-t or C-C C-i)? Ideally I'd like to be able to both navigate to the source code and see the documentation. It might also be good to mention that you need to apt-get install libcurses5-dev for the haskell code to build.
- pjmlp 10y agoI rather use Leksah (http://leksah.org/ http://leksah.org/), but it is nice to see other options available.
- oggy 10y agoIt didn't "just work (TM)" for me, I had to customize the intero-package-version in my .emacs when using it with a project with the latest stack-nightly, to bump it up to "0.1.16". But other than that, wow! I was already very happy whenever I could get ghc-mod and haskell-mode to work, but this takes the responsiveness to a whole different level.
- icc97 10y agoWonderful package. Works nicely on Windows too [1]. [1]: https://ianchanning.wordpress.com/2016/08/11/installing-haskell-emacs-on-windows/