     "UNPACK" "WARNING")
   "Pragmas that GHC supports.")
 
-(defun company-intero (command &optional arg &rest ignored)
+(defun intero-company (command &optional arg &rest ignored)
   "Company source for intero, with the standard COMMAND and ARG args.
 Other arguments are IGNORED."
   (interactive (list 'interactive))
   (cl-case command
-    (interactive (company-begin-backend 'company-intero))
+    (interactive (company-begin-backend 'intero-company))
     (prefix
      (unless (intero-gave-up 'backend)
        (let ((prefix-info (intero-completions-grab-prefix)))

                 (-partial 'intero-company-callback
                           (current-buffer)
                           prefix-info))))))))

(defun intero-company-callback (source-buffer prefix-info cont)
  "Generate completions for SOURCE-BUFFER based on PREFIX-INFO and call CONT on the results."

  (if intero-mode
      (progn (flycheck-select-checker 'intero)
             (flycheck-mode)
             (add-to-list (make-local-variable 'company-backends) 'intero-company)
             (company-mode)
             (setq-local eldoc-documentation-function 'intero-eldoc))
    (message "Intero mode disabled.")))
