Function: haskell-mode-one-line

haskell-mode-one-line is a natively compiled function defined in haskell-string.el.

Signature

(haskell-mode-one-line STR &optional WIDTH)

Documentation

Try to fit STR as much as possible on one line according to given WIDTH.

Source Code

;; Defined in /nix/store/9lz2mhw95f9fqxr9mnq46k3f6qz3aq83-emacs-packages-deps/share/emacs/site-lisp/elpa/haskell-mode-20260904.1042/haskell-string.el
(defun haskell-mode-one-line (str &optional width)
  "Try to fit STR as much as possible on one line according to given WIDTH."
  (unless width
    (setq width (length str)))
  (let* ((long-line (replace-regexp-in-string "\n" " " str))
         (condensed  (replace-regexp-in-string
                      " +" " " (haskell-string-trim long-line))))
    (truncate-string-to-width condensed width nil nil "…")))