 
 (defun th--create-arg-holes (fn-type)
   (s-join " " (-repeat (th--num-of-args fn-type) "_")))
-
-(defun th-insert-relevant-binding-here ()
-  (interactive)
-  (th-insert-relevant-binding (funcall th-get-type-hole-info-function)))
 
 (defun th--binding-extract-name (binding)
   (replace-regexp-in-string " :: .*" "" binding))

  (end-of-line)
  (newline 2))

(defun th-resolve-hole-via-hoogle (str)
  (let ((hole-type (th--get-hole-type str)))
    (funcall completing-read-function "What to insert: " (th-hoogle-search hole-type))))

(defun th-resolve-hole-via-hoogle-here ()
  (interactive)
  (th--replace-type-hole
   (th--hoogle-extract-name
    (th-resolve-hole-via-hoogle
     (funcall th-get-type-hole-info-function)))))

(defun th--hoogle-extract-name (str)

  (string-match "Found hole ‘_’\\(\n\s*\\)? with type: \\([\0-\377[:nonascii:]]*\\)\n\s+Where:" str)
  (s-collapse-whitespace (replace-regexp-in-string "\n" "" (match-string 2 str))))

(defun th-insert-relevant-binding (str &optional add-parens add-arg-holes)
  (let* ((bindings (th-relevant-hole-bindings str))
         (binding (funcall completing-read-function "Which binding? " bindings)))
    (th--replace-type-hole binding)))

(defun th-resolve-hole-relevant-bindings-here (arg)
  (interactive "p")
  (let ((add-parens (>= arg 4))
        (add-arg-holes (>= arg 16)))
    (th-insert-relevant-binding (funcall th-get-type-hole-info-function) add-parens add-arg-holes)))

(defun th-resolve-hole-new-function(str &optional add-parens add-arg-holes)
  (let* ((fn-name (read-string "Name for new function: "))
         (fn-with-type (concat fn-name " :: " (th--get-hole-type str) "\n" fn-name " = _"))
         (fn-with-arg-holes (if add-arg-holes
