Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:set -interactive-print=f does not work #1356

Open
SmartHypercube opened this issue Jul 1, 2022 · 4 comments
Open

:set -interactive-print=f does not work #1356

SmartHypercube opened this issue Jul 1, 2022 · 4 comments

Comments

@SmartHypercube
Copy link
Contributor

I have read the code but cannot figure out why :set -interactive-print=f doesn't work. Could anyone please give me a pointer?

It works in GHCi:

*Main Paths_global_project> :m +Prelude
*Main Paths_global_project Prelude> f a = print a >> print "aha!"
*Main Paths_global_project Prelude> :set -interactive-print=f
*Main Paths_global_project Prelude> f ()
()
"aha!"
*Main Paths_global_project Prelude> 

But doesn't work in iHaskell. The "aha!" part does not get printed.

Context: I'm trying to use pretty-simple as described here: https://hackage.haskell.org/package/pretty-simple#pretty-print-all-ghci-output

@vaibhavsagar
Copy link
Member

vaibhavsagar commented Jul 5, 2022

IHaskell is not GHCi, it is another interface that uses the same underlying GHC API. I think the reason this does not work is that GHCi implements support for reconfigurable pretty-printing explicitly, see https://gitlab.haskell.org/ghc/ghc/-/blob/620ee7edc931dc5273dd04880059cc9ec8d41528/ghc/GHCi/UI.hs#L1036-1049, and we do not (currently).

@SmartHypercube
Copy link
Contributor Author

So it is not enough to use setSessionDynFlags to set the interactivePrint record. Some additional work need to be done. Is my understanding correct?

@vaibhavsagar
Copy link
Member

Yes, that's the current state AFAICT.

@SmartHypercube
Copy link
Contributor Author

I see. Thanks!

(I'll leave this issue open since I still want this feature.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants