A literate programming file for configuring Emacs to use Haskell .
While “they” claim a Gentle Introduction, it doesn’t look fun. I bought the book, Learn You a Haskell for Great Good!, which looks better. Before an Emacsian can dive into a new language, one needs to get an Emacs environment working.
First, get it installed. On a Mac, do something like:
brew install haskell-stack
Which installs the Haskell Stack project that is basically an interface to the kitchen sink.
And then run:
stack setup
And then you get access to an interactive session in a virtual environment with:
stack ghci
Seems that the venerable haskell-mode is the best.
(use-package haskell-mode
:custom
(haskell-process-type 'stack-ghci))
See this configuration for some advanced features.
The hindent package looks interesting:
(use-package hindent
:custom (hindent-style "johan-tibell")
:hook (haskell-mode . #'hindent-mode))
(use-package ob-haskell
:straight (:type built-in)
:config
(add-to-list 'org-babel-load-languages '(haskell . t)))
And let’s see if this works:
nums = filter (> 2) [1 .. 5]
zip nums ['a' .. 'e']
Let’s provide
a name so we can require
this file: