[GHC] #11159: '-interactive-print myPrint' forgotten after :load or :reload
#11159: '-interactive-print myPrint' forgotten after :load or :reload -------------------------------------+------------------------------------- Reporter: hukarere | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Hi, I would like to use a custom print function. I tried all possible ways for setting it: (1) running ghci -interactive-print myPrint; (2) adding ':set -interactive-print myPrint' to ~/.ghci; (3) typing ':set -interactive- print myPrint' interactively. It works, but only before :load or :reload. After that,it's forgotten (standard print used again) and I have to type ':set -interactive-print myPrint' again. Is there a way to make this setting persistent, i. e. survive after :load or :reload? Thanks. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11159> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11159: '-interactive-print myPrint' forgotten after :load or :reload -------------------------------------+------------------------------------- Reporter: hukarere | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by hukarere): * version: 7.10.2 => 7.6.3 Comment: I forgot to mention my version of ghc: 7.6.3. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11159#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11159: '-interactive-print myPrint' forgotten after :load or :reload -------------------------------------+------------------------------------- Reporter: hukarere | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #5461 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * cc: bravit (added) * related: => #5461 Comment: Still a problem with HEAD. Maybe the creator of this feature, @bravit, knows a solution? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11159#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11159: '-interactive-print myPrint' forgotten after :load or :reload -------------------------------------+------------------------------------- Reporter: hukarere | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #5461 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * component: Compiler => GHCi -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11159#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11159: '-interactive-print myPrint' forgotten after :load or :reload -------------------------------------+------------------------------------- Reporter: hukarere | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #5461 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bravit): This was fixed already in [https://phabricator.haskell.org/D867] -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11159#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11159: '-interactive-print myPrint' forgotten after :load or :reload -------------------------------------+------------------------------------- Reporter: hukarere | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #5461 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * cc: watashi (added) Comment: Hi bravit, thanks for having a look. After a `:reload`, the interactive printer doesn't work anymore. Here is an example. {{{ $ cat Test.hs module SpecPrinter where import System.IO sprint a = putStrLn $ show a ++ "!" }}} {{{ $ ~/ghc-devel2/inplace/bin/ghc-stage2 --version The Glorious Glasgow Haskell Compilation System, version 7.11.20151216 }}} {{{ $ ~/ghc-devel2/inplace/bin/ghc-stage2 --interactive -interactive- print=SpecPrinter.sprint Test GHCi, version 7.11.20151216: http://www.haskell.org/ghc/ :? for help [1 of 1] Compiling SpecPrinter ( Test.hs, interpreted ) Ok, modules loaded: SpecPrinter. *SpecPrinter> "hi" "hi"! *SpecPrinter> :reload Ok, modules loaded: SpecPrinter. *SpecPrinter> "hi" "hi" }}} Note that after the `:reload`, the exclamation mark (`!`) isn't printed anymore. Do you agree this is not working as expected? I'm seeing the same behaviour with ghc-7.10.3 as with HEAD. CC @watashi, as the author of D867. I also note that a test was missing from that Diff, so maybe it recently got broken again? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11159#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11159: '-interactive-print myPrint' forgotten after :load or :reload -------------------------------------+------------------------------------- Reporter: hukarere | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #5461 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bravit): Hi thomie, If interactive printing function is defined in external package then it is kept after reloading (thanks to D867, now in HEAD). If it is defined locally then it is no more effective after reloading, it's a new function in some way. I consider this behaviour as reasonable. Don't you agree? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11159#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11159: '-interactive-print myPrint' forgotten after :load or :reload -------------------------------------+------------------------------------- Reporter: hukarere | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #5461 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Thomas Miedema <thomasmiedema@…>): In [changeset:"7cddcde52cf27c55223b1dbb995df623498d0f70/ghc" 7cddcde/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="7cddcde52cf27c55223b1dbb995df623498d0f70" Docs: -interactive-print should reside in registered package Since commit 03c4893e355948fe865bc52c744359c42e4b06d7, ic_int_print is retained from registered packages after `:reload`. Fixes #11159. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11159#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11159: '-interactive-print myPrint' forgotten after :load or :reload -------------------------------------+------------------------------------- Reporter: hukarere | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Documentation | Version: 7.6.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #5461 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * status: new => closed * resolution: => fixed * component: GHCi => Documentation * milestone: => 8.0.1 Comment: Ah, ok, I missed the "external package" part. Sounds reasonable. I updated the User's Guide to mention this. Thanks! -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11159#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC