     :defer t
     :config
     (progn
-      ;; Customization
-      (custom-set-variables
-
-       '(haskell-process-type 'auto)
-
-       ;; Use notify.el (if you have it installed) at the end of running
-       ;; Cabal commands or generally things worth notifying.
-       '(haskell-notify-p t)
-
-       ;; To enable tags generation on save.
-       '(haskell-tags-on-save t)
-
-       ;; Remove annoying error popups
-       '(haskell-interactive-popup-error nil)
-
-       ;; Better import handling
-       '(haskell-process-suggest-remove-import-lines t)
-       '(haskell-process-auto-import-loaded-modules t)
-
-       ;; Disable haskell-stylish on save, it breaks flycheck highlighting
-       '(haskell-stylish-on-save nil))
-
-      ;; Make sure company-ghc is properly initialized
-      (autoload 'ghc-init "ghc" nil t)
-      (autoload 'ghc-debug "ghc" nil t)
-
-      (add-hook 'haskell-mode-hook 'haskell-hook)
+
+      ;; Haskell main editing mode key bindings.
+      (defun spacemacs/init-haskell-mode ()
+        (ghc-init)
+        (when (configuration-layer/package-declaredp 'flycheck)
+          ;; remove overlays from ghc-check.el if flycheck is enabled
+          (set-face-attribute 'ghc-face-error nil :underline nil)
+          (set-face-attribute 'ghc-face-warn nil :underline nil)))
+
+      ;;GHCi-ng
+      (when haskell-enable-ghci-ng-support
+        ;; haskell-process-type is set to auto, so setup ghci-ng for either case
+        ;; if haskell-process-type == cabal-repl
+        (setq haskell-process-args-cabal-repl '("--ghc-option=-ferror-spans" "--with-ghc=ghci-ng"))
+        ;; if haskell-process-type == GHCi
+        (setq haskell-process-path-ghci "ghci-ng")
+
+        (evil-leader/set-key-for-mode 'haskell-mode
+          "mu"   'haskell-mode-find-uses
+          "mt"   'haskell-mode-show-type-at
+          "mgg"  'haskell-mode-goto-loc))
+
+      ;; hooks
+      (add-hook 'haskell-mode-hook 'spacemacs/init-haskell-mode)
       (add-hook 'haskell-cabal-mode-hook 'haskell-cabal-hook)
-
-      ;; Make "RET" behaviour in REPL saner
-      (evil-define-key 'insert haskell-interactive-mode-map (kbd "RET") 'haskell-interactive-mode-return)
-      (evil-define-key 'normal haskell-interactive-mode-map (kbd "RET") 'haskell-interactive-mode-return)
-
-      ;;;;;;;;; Keybindings ;;;;;;;;;;
-
-      ;; major mode specfic prefixes not support for now
-      ;; (spacemacs/declare-prefix "mc" "cabal")
-      ;; (spacemacs/declare-prefix "ms" "repl")
-      ;; (spacemacs/declare-prefix "md" "debug")
-      ;; (spacemacs/declare-prefix "mh" "documentation")
+      (unless haskell-enable-shm-support
+        (add-hook 'haskell-mode-hook 'haskell-indentation-mode))
+
+      ;; settings
+      (setq haskell-process-type 'auto
+            ;; Use notify.el (if you have it installed) at the end of running
+            ;; Cabal commands or generally things worth notifying.
+            haskell-notify-p t
+            ;; To enable tags generation on save.
+            haskell-tags-on-save t
+            ;; Remove annoying error popups
+            haskell-interactive-popup-error nil
+            ;; Better import handling
+            haskell-process-suggest-remove-import-lines t
+            haskell-process-auto-import-loaded-modules t
+            ;; Disable haskell-stylish on save, it breaks flycheck highlighting
+            haskell-stylish-on-save nil)
+
+      ;; Show indentation guides in insert or emacs state only.
+      (defun spacemacs//haskell-identation-show-guides ()
+        "Show the indent guides."
+        (when (eq 'haskell-mode major-mode)
+          (funcall 'haskell-indentation-enable-show-indentations)))
+      (defun spacemacs//haskell-identation-hide-guides ()
+        "Hide the indent guides."
+        (when (eq 'haskell-mode major-mode)
+          (funcall 'haskell-indentation-disable-show-indentations)))
+      ;; first entry in normal state
+      (add-hook 'evil-normal-state-entry-hook
+                'spacemacs//haskell-identation-hide-guides)
+      (dolist (state '(insert emacs))
+        (eval `(progn
+                 (add-hook ',(intern (format "evil-%S-state-entry-hook" state))
+                           'spacemacs//haskell-identation-show-guides)
+                 (add-hook ',(intern (format "evil-%S-state-exit-hook" state))
+                           'spacemacs//haskell-identation-hide-guides))))
+
+      ;; key bindings
+      (defun spacemacs/haskell-process-do-type-on-prev-line ()
+        (interactive)
+        (haskell-process-do-type 1))
 
       (evil-leader/set-key-for-mode 'haskell-mode
         "mgg"  'haskell-mode-jump-to-def-or-tag

    (progn
      (setq hindent-style haskell-enable-hindent-style)
      (evil-leader/set-key-for-mode 'haskell-mode
        "mF"   'hindent/reformat-decl))))

(defun haskell-process-do-type-on-prev-line ()
  (interactive)
  (haskell-process-do-type 1))

(defun haskell/init-haskell-mode ()
  (require 'haskell-yas)

    flycheck-haskell
    ghc
    haskell-mode
    ;; hi2
    hindent
    shm
    ))
