public
Created

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
(require 'util)
(require 'flycheck)
(require 'evil-leader)
 
;;; Code:
 
(add-to-list 'exec-path "~/.cabal/bin/")
(add-to-list 'exec-path "~/Library/Haskell/current/bin/")
 
(install-and-require #'haskell-mode)
(install-and-require #'ghc)
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
(setq haskell-program-name "~/Library/Haskell/current/bin/ghci")
 
(load-and-use #'hsenv)
 
(autoload 'ghc-init "ghc" nil t)
(add-hook 'haskell-mode-hook (lambda () (ghc-init)))
 
 
(ac-define-source ghc-mod
'((depends ghc)
(candidates . (ghc-select-completion-symbol))
(symbol . "s")
(document . haskell-doc-sym-doc)
(cache)))
 
 
(defun haskell-autocomplete ()
(setq ac-sources (list 'ac-source-ghc-mod
'ac-source-words-in-same-mode-buffers
)))
(add-hook 'haskell-mode-hook 'haskell-autocomplete)
 
 
(flycheck-declare-checker haskell-hlint
"A Haskell syntax and style checker using hlint.
See URL `http://community.haskell.org/~ndm/hlint/'."
:command '("hlint" source-inplace)
:error-patterns
'(("^\\(?1:.*\\):\\(?2:[0-9]+\\):\\(?3:[0-9]+\\): Warning: \\(?4:.*\\(\n.+\\)+\\)" warning)
("^\\(?1:.*\\):\\(?2:[0-9]+\\):\\(?3:[0-9]+\\): Error: \\(?4:.*\\(\n.+\\)+\\)" error))
:modes 'haskell-mode)
(push 'haskell-hlint flycheck-checkers)
 
 
(flycheck-define-checker haskell-hdevtools
"A Haskell syntax and type checker using hdevtools.
See URL `https://github.com/bitc/hdevtools'."
:command ("hdevtools" "check" "-g" "-Wall" source-inplace)
:error-patterns
((warning line-start (file-name) ":" line ":" column ":"
(or " " "\n ") "Warning:" (optional "\n")
(one-or-more " ")
(message (one-or-more not-newline)
(zero-or-more "\n"
(one-or-more " ")
(one-or-more not-newline)))
line-end)
(error line-start (file-name) ":" line ":" column ":"
(or (message (one-or-more not-newline))
(and "\n" (one-or-more " ")
(message (one-or-more not-newline)
(zero-or-more "\n"
(one-or-more " ")
(one-or-more not-newline)))))
line-end))
:modes haskell-mode
:next-checkers (haskell-hlint))
(push 'haskell-hdevtools flycheck-checkers)
 
 
;;; CUSTOM KEYMAPS
(evil-leader/set-key-for-mode 'haskell-mode
"h" 'haskell-hayoo
"c b" 'inferior-haskell-load-file)
 
(provide 'haskell-conf)
;;; haskell-conf.el ends here

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.