Skip to content

Latest commit

 

History

History
94 lines (82 loc) · 3.24 KB

ha-programming-haskell.org

File metadata and controls

94 lines (82 loc) · 3.24 KB

Programming Haskell

A literate programming file for configuring Emacs to use Haskell .

Introduction

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

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 let’s see if this works:

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

Technical Artifacts

Let’s provide a name so we can require this file: