3 ms·
I'm curious what about Ocaml's Emacs mode is better. I use dante for Haskell in Emacs which is good, but I'm always interesting in hearing about better technol
by tome 6y ago
I'm curious what about Ocaml's Emacs mode is better. I use dante for Haskell in Emacs which is good, but I'm always interesting in hearing about better technologies.
- momentoftop 6y agoI'm not the parent, but thanks for the link to Dante. One of the main things I like about Ocaml and merlin is how robustly it can tell you the types of expressions by hitting "C-t". It usually works on incomplete code, and it will tell you the type of arbitrary subexpressions (not just identifiers) in your selected region. It will do automatic destructuring of an identifier (producing a match/case expression with the patterns in the ADTs filled in for you). It's not perfect, but I use it a lot for complex ADTs. The autocompletion is great too. It will complete for local variables in scope, and it must be having to do some fairly complex stuff in the background, since it'll autocomplete for local modules applied to functors. For example, you can write let foo x = let open Foo(Bar) in ... and when you autocomplete inside the "...", it will bring in completions from the module generated by applying Bar to Foo. I'd be interested to hear how dante compares.
- tome 6y agoThanks! > I'd be interested to hear how dante compares. > it can tell you the types of expressions dante has flaky support for this > It will do automatic destructuring of an identifier dante does support this. It's a bit hokey because the code it inserts doesn't match pre-existing indentation, but it is useful. > The autocompletion is great too. It will complete for local variables in scope That sounds very cool. I don't think dante does that, although I've never tried it.
- smabie 6y agoThe keybinding (by default), is C-c C-t, btw.