hamacs/ha-programming-haskell.org
Howard Abrams 988c0dac2e Decided I like lowercase headers better
Oh, and let's fix the FILETAGS. Thank goodness for woccurrrrrr.
2024-03-06 20:02:25 -08:00

3.2 KiB
Raw Blame History

Programming Haskell

A literate programming file for configuring Emacs to use Haskell .

Introduction

While “they” claim a Gentle Introduction, it doesnt 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

Haskell Mode

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))

Haskell and Org

  (use-package ob-haskell
    :straight (:type built-in)
    :config
    (add-to-list 'org-babel-load-languages '(haskell . t)))

And lets see if this works:

  nums = filter (> 2) [1 .. 5]
  zip nums ['a' .. 'e']
3 a
4 b
5 c