Giter Club home page Giter Club logo

dante's Introduction

Dante: Emacs mode for Interactive Haskell

https://badges.gitter.im/dante-mode/Lobby.svg https://melpa.org/packages/dante-badge.svg https://stable.melpa.org/packages/dante-badge.svg

Dante is a fork of Intero mode. It steals many good ideas from Intero, but it aims for light weightedness (see below for a detailed comparison).

Features

FeatureCommandKeybinding
Flycheck type checkingflycheck-mode
Type of selectiondante-type-atC-c .
Info at pointdante-infoC-c ,
Apply Ghc suggestion for error at pointdante-auto-fixC-c /
Goto definitionxref-find-definitionsM-.
Find usesxref-find-referencesM-?
REPLoid (*)dante-eval-blockC-c ’
Restartdante-restart

(*) REPLoid explanation:

You can evaluate code by writing it in a comment of the form {-> [code to evaluate] -} and run dante-eval-block.

Example:

example :: [String]
example = ["This is an example", "of", "interactive", "evaluation"]

{-> intercalate " " example

-}

In the above file, if you invoke dante-eval-block on the line containing “intercalate”, you’ll get:

{-> intercalate " " example

"This is an example of interactive evaluation"
-}

Installation

Turn on Dante in your haskell-mode-hook. I recommend:

(use-package dante
  :ensure t
  :commands 'dante-mode
  :init
  (add-hook 'haskell-mode-hook 'dante-mode)
  (add-hook 'haskell-mode-hook 'flycheck-mode))

You may want to be sure not to enable (interactive-haskell-mode) so that Dante keybindings are not hidden.

Using dante + hlint

You can activate the hlint checker in addition to the dante checker as follows:

(add-hook 'dante-mode-hook
   '(lambda () (flycheck-add-next-checker 'haskell-dante
                '(warning . haskell-hlint)))

Customization

Use M-x customize-group dante

Comparison with Intero

To the best of my knowledge, here is how Dante compares with Intero:

  • Dante has no dependency on “Stack”
  • Dante’s Emacs code is about half as long as that of Intero.
  • Dante does not depend on custom Haskell code, contrary to intero. Thus, it will if (and only if) GHCi works for your project. (Including via “Stack”).
  • Dante supports xref-find-definitions and xref-find-references.
  • With Dante, Flychecking is optional (yet recommended), whereas Intero demands that you flycheck your code.
  • Dante has has a different approach to Haskell evaluation
  • Dante offers no support for Hoogle nor eldoc.

dante's People

Contributors

aljce avatar drvink avatar jyp avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.