Quick
index
main
eev
eepitch
maths
angg
blogme
dednat6
littlelangs
PURO
(C2,C3,C4,
 λ,ES,
 GA,MD,
 Caepro,
 textos,
 Chapa 1)

emacs
lua
(la)tex
maxima
git
lean4
agda
forth
squeak
icon
tcl
tikz
fvwm
debian
irc
contact

Eev and Haskell

I am trying to learn Haskell,
and trying to make it easy to use from REPLs with eepitch.
All the "notes" links below point to "executable notes".

I am using a GHC installed with GHCup (notes),
with cabal-install (disambiguation) from Debian (notes),
and with Hoogle installed from Hackage (notes, notes).
Debian has packages for the report and the tutorial for Haskell98 (notes),
and I saw that I can use eev-rstdoc.el to point to them, like this:

-- (find-h98doc "index")
-- (find-h98tdoc "index")
-- (find-ghcugdoc "index")


1. `find-cabal-links'

One thing that I found very annoying about Haskell is that after installing a package with cabal-install I had to use commands like this

ghc-pkg --package-db=/home/edrx/.cabal/store/ghc-8.8.4/package.db describe hoogle

to get information on an installed package; I don't know how to set a default value for "--package-db" yet, so I wrote this shell script as a workaround: ~/bin/eev-cabal. When I run this sexp (a 5-minute hack!),

# (find-cabal-links "hoogle")

it displays a temporary buffer like the one at the upper right in the screenshot below (click to enlarge it!), that contains several elisp hyperlinks that invoke eev-cabal with different arguments,

After those hyperlinks it shows an eepitch block for installing that package, and a link like this -

# (find-cabal-unpack "hoogle")

that only works correctly on installed packages, and that displays a temporary buffer like the one at the lower right part of the screenshot, that unpacks the source code of that package into a directory with a short name, and produces a code-c-d for it. The code in Lisp for find-cabal-links and find-cabal-unpack is quite simple, but I was only able to write eev-cabal after getting a lot of help in the #haskell IRC channel. =/


2. `find-ghc-links'

Here is another 5-minute hack that I am using a lot: find-ghc-links. When I type `M-x find-ghc-links' or `M-x ghl' it displays a temporary buffer like this (click to enlarge!),

with some useful links on the word around point. It works for both functions and names of modules - some of the links are only meaningful when the argument is the name of a function, and some only when it is the name of a module.


See also: http://angg.twu.net/HASKELL/.