Do TypeReps need to be cyclic? No – I think David is working on a non-cyclic version Simon From: ghc-devs [mailto:ghc-devs-bounces@haskell.org] On Behalf Of Simon Marlow Sent: 02 November 2017 10:27 To: David Feuer <david.feuer@gmail.com> Cc: Joachim Breitner <mail@joachim-breitner.de>; ghc-devs <ghc-devs@haskell.org> Subject: Re: Bringing some observable sharing to GHCi Not being able to :print an exception would be quite annoying. Do TypeReps need to be cyclic? 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. Cheers Simon On 29 October 2017 at 20:40, David Feuer <david.feuer@gmail.com<mailto:david.feuer@gmail.com>> wrote: The :sprint, :print, and :force commands in GHCi fall into infinite loops when confronted by cyclical data. This bit me hard in https://phabricator.haskell.org/D4085 because that produces cyclical TypeReps, which is trouble for (e.g.) the test break011 which tries to :force a SomeException (which wraps an Exception dictionary, which has a Typeable constraint). I could try coming up with a fix myself, but I'm rather curious whether some of the work you (or others) have already done on observing GHC data graphs could be yanked into GHCi itself for this purpose. We want 1. To be able to display cyclical data in some sensible way.
x = "hi" : x x `seq` () :print x
should print some useful representation of x. 2. To be able to force cyclical data without looping.
x = "hi" : x :force x
should print a useful representation of x. _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org<mailto:ghc-devs@haskell.org> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs<https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmail.haskell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fghc-devs&data=02%7C01%7Csimonpj%40microsoft.com%7Ca85ca64bedd043ccfffc08d521dc59b5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636452152651212039&sdata=Ls32xDyWGP4oKhwrkbrxXf7nog1TtxbjGbjrODiwzB4%3D&reserved=0>