                        (buffer-substring-no-properties (car bounds)
                                                        (cdr bounds))))
          (result (merlin-type-of-expression bounds substring)))
-    (cond
-     ((not (cdr result))
-      (if (not quiet)
-          (message "<no information>"))) ;; no types
-     ((and (not (merlin-is-long (cdr result)))
-           (not quiet))
-      (merlin-create-overlay 'merlin-type-overlay
-                             (car result)
-                             'next-error "1 sec")
-      (message "%s" (cdr result)))
-     ((not (merlin-is-long (cdr result)))
-      (message "%s"
-               (cdr result)))
-     ((not quiet)
-      (display-buffer merlin-type-buffer)
-      (with-current-buffer merlin-type-buffer
-        (erase-buffer)
-        (insert (cdr result)))))))
+    (merlin-display-type (car result) (cdr result) &optional quiet)))
 
 (defun merlin-show-type-def ()
   "Prints the definition of the type of the term under point"

   (merlin-type-of-expression-local bounds exp)
   (merlin-type-of-expression-global bounds exp)))

(defun merlin-show-type (bounds &optional quiet)
  "This functions shows the type of the expression inside
`bounds' in the current buffer. If `quiet' is non nil then an

      (if (> arg 1)
          (merlin-type-enclosing-go-down)
        (merlin-type-enclosing-go-up))
    (if (> arg 1)
        (merlin-show-type-of-region)
      (progn
        (setq merlin-last-point-type (point))
        (merlin-type-enclosing)
        (if (not merlin-enclosing-types)
            (merlin-show-type-of-point arg)
          (merlin-type-enclosing-go-up))))))

(defun merlin-type-enclosing-go ()
  "Highlight the given corresponding enclosing data (of the form (type . bounds)"
  (let ((data (elt merlin-enclosing-types merlin-enclosing-offset)))
    (if (cddr data)
        (merlin-display-type (cdr data) (car data)))))

(defun merlin-type-enclosing-go-up ()
  "Goes up in the enclosing type zipper."
