;; Licensed under a Creative Commons Attribution 4.0 International License.
;; See http://creativecommons.org/licenses/by/4.0/
;;
;; Author: Howard X. Abrams <http://gitlab.com/howardabrams>
;; Maintainer: Howard X. Abrams
;; Created: August 24, 2022
;;
;; While obvious, GNU Emacs does not include this file or project.
;;
;; *NB:* Do not edit this file. Instead, edit the original literate file at:
;; ~/other/hamacs/ha-programming-haskell.org
;; And tangle the file to recreate this one.
;;
;;; Code:
#+end_src
* Introduction
While “they” claim a [[https://www.haskell.org/tutorial/][Gentle Introduction]], it doesn’t look /fun/. I bought the book, [[http://learnyouahaskell.com/chapters][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:
#+begin_src sh
brew install haskell-stack
#+end_src
Which installs the [[https://docs.haskellstack.org/][Haskell Stack]] project that is basically an interface to the /kitchen sink/.
And then run:
#+begin_src sh
stack setup
#+end_src
And then you get access to an interactive session in a virtual environment with:
#+begin_src sh
stack ghci
#+end_src
* Haskell Mode
Seems that the venerable [[https://github.com/haskell/haskell-mode][haskell-mode]] is the best.
#+begin_src emacs-lisp
(use-package haskell-mode
:custom
(haskell-process-type 'stack-ghci))
#+end_src
See [[https://input-output-hk.github.io/adrestia/resources/Emacs][this configuration]] for some advanced features.
The [[https://github.com/mihaimaruseac/hindent][hindent package]] looks interesting: