Skip to content

Commit 6ebf013

Browse files
authored
Merge pull request #1515 from slpopejoy/optional-set-plus-c
Add defcustom for :set +c
2 parents b0a5743 + c714d81 commit 6ebf013

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

haskell-commands.el

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@
4242
:group 'haskell
4343
:type 'string)
4444

45+
(defcustom haskell-interactive-set-+c
46+
t
47+
"Issue ':set +c' in interactive session to support type introspection."
48+
:group 'haskell-interactive
49+
:type 'boolean)
50+
4551
;;;###autoload
4652
(defun haskell-process-restart ()
4753
"Restart the inferior Haskell process."
@@ -101,9 +107,10 @@ You can create new session using function `haskell-session-make'."
101107
;; whole produces only one prompt marker as a response.
102108
(haskell-process-send-string process
103109
(mapconcat #'identity
104-
'("Prelude.putStrLn \"\""
105-
":set -v1"
106-
":set +c") ; :type-at in GHC 8+
110+
(append '("Prelude.putStrLn \"\""
111+
":set -v1")
112+
(when haskell-interactive-set-+c
113+
'(":set +c"))) ; :type-at in GHC 8+
107114
"\n"))
108115
(haskell-process-send-string process ":set prompt \"\\4\"")
109116
(haskell-process-send-string process (format ":set prompt2 \"%s\""
@@ -662,7 +669,7 @@ happened since function invocation)."
662669
('unknown-command
663670
(message "This command requires GHCi 8+ or GHCi-ng. Please read command description for details."))
664671
('option-missing
665-
(message "Could not infer type signature. You need to load file first. Also :set +c is required. Please read command description for details."))
672+
(message "Could not infer type signature. You need to load file first. Also :set +c is required, see customization `haskell-interactive-set-+c'. Please read command description for details."))
666673
('interactive-error (message "Wrong REPL response: %s" sig))
667674
(otherwise
668675
(if insert-value

0 commit comments

Comments
 (0)