<div dir="ltr">Not being able to :print an exception would be quite annoying. Do TypeReps need to be cyclic?<div><br></div><div>Observable sharing can be done with StableName, but that would be a bit pile of hassle in the printer. Maybe exceptions warrant a special case.<br><div><br></div><div>Cheers</div><div>Simon</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 29 October 2017 at 20:40, David Feuer <span dir="ltr"><<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The :sprint, :print, and :force commands in GHCi fall into infinite<br>
loops when confronted by cyclical data. This bit me hard in<br>
<a href="https://phabricator.haskell.org/D4085" rel="noreferrer" target="_blank">https://phabricator.haskell.<wbr>org/D4085</a> because that produces cyclical<br>
TypeReps, which is trouble for (e.g.) the test break011 which tries to<br>
:force a SomeException (which wraps an Exception dictionary, which has<br>
a Typeable constraint). I could try coming up with a fix myself, but<br>
I'm rather curious whether some of the work you (or others) have<br>
already done on observing GHC data graphs could be yanked into GHCi<br>
itself for this purpose. We want<br>
<br>
1. To be able to display cyclical data in some sensible way.<br>
<br>
> x = "hi" : x<br>
> x `seq` ()<br>
> :print x<br>
<br>
should print some useful representation of x.<br>
<br>
2. To be able to force cyclical data without looping.<br>
<br>
> x = "hi" : x<br>
> :force x<br>
<br>
should print a useful representation of x.<br>
______________________________<wbr>_________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div><br></div>