`haskell-interactive-type-show-for-ambiguous` is not respected
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 74/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- emacs-lisp, haskell
- Ambito
- developer-experience, tooling
Direzione di ricerca
Inizia in haskell-interactive-mode.el, in haskell-interactive-mode-trigger-compile-error, soprattutto nei controlli intorno alle righe 1036 e 1045. Riproduci la risposta con GHC 9.12.2 e verifica come viene confrontato il testo dell'errore. Il lavoro è completato quando la visualizzazione del tipo documentata funziona per l'errore Show segnalato e la gestione esistente di process-error rimane intatta.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi, I'm used to having non-Showable objects printed as their types, as the variable haskell-interactive-type-show-for-ambiguous is documented to do, but it's currently not working. Some debugging shows that the haskell process is not giving exactly the same error message as what is expected. Here's the full backtrace:
*Backtrace*
Debugger entered--entering a function:
* haskell-interactive-mode-trigger-compile-error((((name . "haskell") (next-error-region #<marker at 338 in *haskell*> . #<marker (moves after insertion) at 338 in *haskell*>) (next-error-locus) (interactive-buffer . #<buffer *haskell*>) (current-dir . "/home/rvs314/.tmp/") (cabal-checksum) (cabal-dir . "/home/rvs314/.tmp/") (process (name . "haskell") (current-response-cursor . 0) (current-response . "<interactive>:19:1-4: error: [GHC-39999]\n • No instance for ‘Show (() -> String)’\n arising from a use of ‘print’\n (maybe you haven't applied a function to enough arguments?)\n • In a stmt of an interactive GHCi command: print it\n\n\4") (command-queue) (inferior-process . #<process haskell>) (is-restarting) (current-command . #s(haskell-command :state #1 :go #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_12> :live #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_13> :complete #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_14>)) (suggested-imported) (sent-stdin) (evaluating) (session . #2))) ((name . "haskell") (current-response-cursor . 0) (current-response . "<interactive>:19:1-4: error: [GHC-39999]\n • No instance for ‘Show (() -> String)’\n arising from a use of ‘print’\n (maybe you haven't applied a function to enough arguments?)\n • In a stmt of an interactive GHCi command: print it\n\n\4") (command-queue) (inferior-process . #<process haskell>) (is-restarting) (current-command . #s(haskell-command :state #1 :go #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_12> :live #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_13> :complete #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_14>)) (suggested-imported) (sent-stdin) (evaluating) (session (name . "haskell") (next-error-region #<marker at 338 in *haskell*> . #<marker (moves after insertion) at 338 in *haskell*>) (next-error-locus) (interactive-buffer . #<buffer *haskell*>) (current-dir . "/home/rvs314/.tmp/") (cabal-checksum) (cabal-dir . "/home/rvs314/.tmp/") (process . #3))) "show" 250) "<interactive>:19:1-4: error: [GHC-39999]\n • No instance for ‘Show (() -> String)’\n arising from a use of ‘print’\n (maybe you haven't applied a function to enough arguments?)\n • In a stmt of an interactive GHCi command: print it\n\n")
#<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_14>((((name . "haskell") (next-error-region #<marker at 338 in *haskell*> . #<marker (moves after insertion) at 338 in *haskell*>) (next-error-locus) (interactive-buffer . #<buffer *haskell*>) (current-dir . "/home/rvs314/.tmp/") (cabal-checksum) (cabal-dir . "/home/rvs314/.tmp/") (process (name . "haskell") (current-response-cursor . 0) (current-response . "<interactive>:19:1-4: error: [GHC-39999]\n • No instance for ‘Show (() -> String)’\n arising from a use of ‘print’\n (maybe you haven't applied a function to enough arguments?)\n • In a stmt of an interactive GHCi command: print it\n\n\4") (command-queue) (inferior-process . #<process haskell>) (is-restarting) (current-command . #s(haskell-command :state #1 :go #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_12> :live #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_13> :complete #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_14>)) (suggested-imported) (sent-stdin) (evaluating) (session . #2))) ((name . "haskell") (current-response-cursor . 0) (current-response . "<interactive>:19:1-4: error: [GHC-39999]\n • No instance for ‘Show (() -> String)’\n arising from a use of ‘print’\n (maybe you haven't applied a function to enough arguments?)\n • In a stmt of an interactive GHCi command: print it\n\n\4") (command-queue) (inferior-process . #<process haskell>) (is-restarting) (current-command . #s(haskell-command :state #1 :go #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_12> :live #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_13> :complete #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_14>)) (suggested-imported) (sent-stdin) (evaluating) (session (name . "haskell") (next-error-region #<marker at 338 in *haskell*> . #<marker (moves after insertion) at 338 in *haskell*>) (next-error-locus) (interactive-buffer . #<buffer *haskell*>) (current-dir . "/home/rvs314/.tmp/") (cabal-checksum) (cabal-dir . "/home/rvs314/.tmp/") (process . #3))) "show" 250) "<interactive>:19:1-4: error: [GHC-39999]\n • No instance for ‘Show (() -> String)’\n arising from a use of ‘print’\n (maybe you haven't applied a function to enough arguments?)\n • In a stmt of an interactive GHCi command: print it\n\n")
haskell-command-exec-complete(#s(haskell-command :state (((name . "haskell") (next-error-region #<marker at 338 in *haskell*> . #<marker (moves after insertion) at 338 in *haskell*>) (next-error-locus) (interactive-buffer . #<buffer *haskell*>) (current-dir . "/home/rvs314/.tmp/") (cabal-checksum) (cabal-dir . "/home/rvs314/.tmp/") (process (name . "haskell") (current-response-cursor . 0) (current-response . "<interactive>:19:1-4: error: [GHC-39999]\n • No instance for ‘Show (() -> String)’\n arising from a use of ‘print’\n (maybe you haven't applied a function to enough arguments?)\n • In a stmt of an interactive GHCi command: print it\n\n\4") (command-queue) (inferior-process . #<process haskell>) (is-restarting) (current-command . #1) (suggested-imported) (sent-stdin) (evaluating) (session . #3))) ((name . "haskell") (current-response-cursor . 0) (current-response . "<interactive>:19:1-4: error: [GHC-39999]\n • No instance for ‘Show (() -> String)’\n arising from a use of ‘print’\n (maybe you haven't applied a function to enough arguments?)\n • In a stmt of an interactive GHCi command: print it\n\n\4") (command-queue) (inferior-process . #<process haskell>) (is-restarting) (current-command . #1) (suggested-imported) (sent-stdin) (evaluating) (session (name . "haskell") (next-error-region #<marker at 338 in *haskell*> . #<marker (moves after insertion) at 338 in *haskell*>) (next-error-locus) (interactive-buffer . #<buffer *haskell*>) (current-dir . "/home/rvs314/.tmp/") (cabal-checksum) (cabal-dir . "/home/rvs314/.tmp/") (process . #4))) "show" 250) :go #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_12> :live #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_13> :complete #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_14>) "<interactive>:19:1-4: error: [GHC-39999]\n • No instance for ‘Show (() -> String)’\n arising from a use of ‘print’\n (maybe you haven't applied a function to enough arguments?)\n • In a stmt of an interactive GHCi command: print it\n\n")
haskell-process-collect(((name . "haskell") (next-error-region #<marker at 338 in *haskell*> . #<marker (moves after insertion) at 338 in *haskell*>) (next-error-locus) (interactive-buffer . #<buffer *haskell*>) (current-dir . "/home/rvs314/.tmp/") (cabal-checksum) (cabal-dir . "/home/rvs314/.tmp/") (process (name . "haskell") (current-response-cursor . 0) (current-response . "<interactive>:19:1-4: error: [GHC-39999]\n • No instance for ‘Show (() -> String)’\n arising from a use of ‘print’\n (maybe you haven't applied a function to enough arguments?)\n • In a stmt of an interactive GHCi command: print it\n\n\4") (command-queue) (inferior-process . #<process haskell>) (is-restarting) (current-command . #s(haskell-command :state (#1 #10 "show" 250) :go #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_12> :live #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_13> :complete #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_14>)) (suggested-imported) (sent-stdin) (evaluating) (session . #1))) " print it\n\n\4" ((name . "haskell") (current-response-cursor . 0) (current-response . "<interactive>:19:1-4: error: [GHC-39999]\n • No instance for ‘Show (() -> String)’\n arising from a use of ‘print’\n (maybe you haven't applied a function to enough arguments?)\n • In a stmt of an interactive GHCi command: print it\n\n\4") (command-queue) (inferior-process . #<process haskell>) (is-restarting) (current-command . #s(haskell-command :state (((name . "haskell") (next-error-region #<marker at 338 in *haskell*> . #<marker (moves after insertion) at 338 in *haskell*>) (next-error-locus) (interactive-buffer . #<buffer *haskell*>) (current-dir . "/home/rvs314/.tmp/") (cabal-checksum) (cabal-dir . "/home/rvs314/.tmp/") (process . #3)) #3 "show" 250) :go #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_12> :live #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_13> :complete #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_14>)) (suggested-imported) (sent-stdin) (evaluating) (session (name . "haskell") (next-error-region #<marker at 338 in *haskell*> . #<marker (moves after insertion) at 338 in *haskell*>) (next-error-locus) (interactive-buffer . #<buffer *haskell*>) (current-dir . "/home/rvs314/.tmp/") (cabal-checksum) (cabal-dir . "/home/rvs314/.tmp/") (process . #3))))
haskell-process-filter(#<process haskell> " print it\n\n\4")
The response GHC seems to be giving back is:
<interactive>:24:1-3: error: [GHC-39999]
• No instance for ‘Show (Integer -> Integer -> Integer)’
arising from a use of ‘print’
(maybe you haven't applied a function to enough arguments?)
• In a stmt of an interactive GHCi command: print it
Which doesn't match the regexes used in the definition of haskell-interactive-mode-trigger-compile-error when first checking for an error (there's no newline to begin the message) then later when it is checked to be a Show error (GHC uses ‘ rather than ( to delimit the constraint). If you modify them to match the error message, then everything else works. I'm not sure if this is a regression that should be solved that way, as I'm not too familiar with the internals of how the process handling works, but I'd be happy to send over my changes as a PR if they are appropriate.
Versions
``` ~ $ version GNU Emacs 30.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.51, cairo version 1.18.4) of 2025-12-03, modified by Debian ~ $ ghc --version The Glorious Glasgow Haskell Compilation System, version 9.12.2 ```- Lingua principale
- Emacs Lisp
- Stelle
- 1.4k
- Fork
- 357
- Merge medio
- 7h 50m
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di haskell/haskell-mode
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
haskell/haskell-mode#1522 ·
-
haskell-indentation: identifier named `signature` breaks indentation for the rest of the declarationForse già presa @PerryLink l’ha presa 48 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 78/100
haskell/haskell-mode#1895 ·
-
.hsc/CPP Can't find headers.Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
haskell/haskell-mode#1892 ·
-
Need help with haskell-modeAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
haskell/haskell-mode#1890 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
haskell/haskell-mode#1888 · 2 commenti ·
Tutte le issue di haskell/haskell-mode
Issue simili
-
area: middleware enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
rohitgollarahalli/mcpx#45 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
facebookresearch/atlas-lean#20218 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100