   (mapcar (lambda (x) (append x '((kind . "Label") (info . nil)))) labels))
 
 (defun merlin--completion-data (ident)
-  "Return the data for completion of IDENT, i.e. a list of pairs (NAME . TYPE)."
+  "Return the data for completion of IDENT, i.e. a list of lists of the form
+  '(NAME TYPE KIND INFO)."
   (setq-local dwimed nil)
   (let* ((ident- (merlin--completion-split-ident ident))
          (suffix (cdr ident-))

;;; COMPANY MODE SUPPORT ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun merlin--company-doc-buffer (candidate)
  "Computes the /doc/ of CANDIDATE and returns the buffer where it printed it"
  ; TODO: at the moment "doc" is understood as "type", but hopefully someday we
  ; will access ocamldoc comments and display that.
  (let ((typ (get-text-property 0 'merlin-meta candidate)))
    (if (not (equal typ " <module>"))
      (merlin--type-display-in-buffer typ)
      (let* ((expr (substring-no-properties candidate))
             (loc  (merlin-unmake-point (point)))
             (cmd  (list 'type 'expression expr 'at loc))
             (res  (merlin-send-command cmd)))
        (merlin--type-display-in-buffer res)))
    (get-buffer merlin-type-buffer-name)))

(defun merlin-company-backend (command &optional arg &rest ignored)
    (interactive (list 'interactive))

              (mapcar #'(lambda (x)
                          (propertize
                            (propertize
                              (propertize
                                (merlin--completion-full-entry-name prefix x)
                                'merlin-compl-type
                                (merlin--completion-format-entry x))
                              'merlin-arg-type
                              (cdr (assoc 'argument_type x))))
                          'merlin-compl-doc
                          (cdr (assoc 'info x)))
                      (merlin--completion-data arg))))
          (post-completion
            (let ((minibuffer-message-timeout nil))
              (minibuffer-message "%s : %s" arg (merlin--company-get-candidate-type arg))))
          (meta (merlin--company-meta arg))
          (annotation
            (concat " : " (merlin--company-get-candidate-type arg))))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; AUTO-COMPLETE SUPPORT ;;
