[Haskell-cafe] Flymake Haskell

Daisuke IKEGAMI ikegami at madscientist.jp
Wed Nov 7 22:57:37 EST 2007


Hello emacsen users, 

Here is a setting to check your Haskell code /on-the-fly/ 
with 'flymake-mode'.

  (require 'flymake)
  
  ;; flymake for Haskell
  (defun flymake-Haskell-init ()
    (flymake-simple-make-init-impl
      'flymake-create-temp-with-folder-structure nil nil
      buffer-file-name
      'flymake-get-Haskell-cmdline))
  (defun flymake-get-Haskell-cmdline (source base-dir)
    (list "ghc" (list "--make" (concat "-i" base-dir) source)))
  (push '(".+\\.hs$" flymake-Haskell-init)
    flymake-allowed-file-name-masks)
  (push '(".+\\.lhs$" flymake-Haskell-init)
    flymake-allowed-file-name-masks)
  (push '("^\\(.*\\):\\([0-9]+\\):\\([0-9]+\\): \\(.*\\)$" 1 2 3 4)
    flymake-err-line-patterns)

The 'flymake-mode' has been developed at http://flymake.sourceforge.net/
Emacs22 has this mode already.

dons recommends to me at IRC to write this code into the wiki, however, 
I don't know where we should put the snippet.

You can watch a short demo at the following blog:
  http://madscientist.jp/~ikegami/diary/20071108.html#p01

I have some complaints though it works:
  - it's slow (hmm)
  - error and warning seems not distinguished
      (we may have to modify 'flymake-err-line-patterns')
Any comment is appreciated.

Best regards,
Ike

P.S.
I like vi-clone, such as vim, too. ;-)


More information about the Haskell-Cafe mailing list