 (require 'company)
 (use-package haskell-mode
   :ensure t
+  :init
+  (autoload 'ghc-init "ghc" nil t)
+  (autoload 'ghc-debug "ghc" nil t)
+  (add-hook 'haskell-mode-hook 'ghc-init)
+  (setq haskell-notify-p t
+        haskell-tags-on-save t
+        haskell-interactive-popup-errors nil
+        haskell-process-suggest-remove-import-lines t
+        haskell-process-auto-import-loaded-modules t
+        haskell-stylish-on-save t
+        )
   :config
+  (use-package cmm-mode :ensure t :defer t)
+
   (use-package company-ghc
     :ensure t
     :defer t
     :config
-    (add-to-list 'company-backends 'company-ghc))
+    (add-to-list 'company-backends '(company-ghc :with company-dabbrev-code))
+    )
+
+  (use-package company-cabal
+    :ensure t
+    :defer t
+    :config
+    (add-to-list 'company-backends 'company-cabal))
+
+  (use-package flycheck-haskell
+    :ensure t
+    :after flycheck
+    :config
+    (add-hook 'flycheck-mode-hook 'flycheck-haskell-setup)
+    ;; (set-face-attribute 'ghc-face-error nil :underline nil)
+    ;; (set-face-attribute 'ghc-face-warn nil :underline nil)
+    )
 
   (use-package shm
     :ensure t


  (use-package hindent
    :ensure t
    :config
    (add-hook 'haskell-mode-hook 'hindent-mode))

  (defun run-haskell ()
    (interactive)

  ;;             (set (make-local-variable 'company-backends)
  ;;                  (append '((company-capf company-dabbrev-code))
  ;;                          company-backends))))
  (setq-default haskell-stylish-on-save t)
  (custom-set-variables
   '(haskell-tags-on-save t)
