Re: Show instances for GHC internals

2015-10-20 Thread Edward Z. Yang
Excerpts from Ömer Sinan Ağacan's message of 2015-10-20 06:37:44 -0700: > Edward, do you remember any examples of such code? The big kahuna is interface loading. Everything TyThing from loadDecls is done (unsafely) lazily. In fact, must be, because TyThings are a mutually recursive structure.

Re: Show instances for GHC internals

2015-10-20 Thread Ömer Sinan Ağacan
> One difficulty is that many of the core type data types, e.g. TyThing, > are (1) a large mutually recursive graph, and (2) have > unsafeInterleaveIO thunks which would induce IO action. So a naive > Show instance would give infinite output and have lots of side effects. > There are many data

Re: Show instances for GHC internals

2015-10-20 Thread Ömer Sinan Ağacan
> There are more interesting parts of your post, but I can respond to this: It > shouldn't take that much time. Once you have ghc-stage2 built, you should be > able to say `make 2` in the ./ghc subdirectory and get a new binary in a few > seconds. > > Using `make 1` in the ./compiler subdirectory

Re: Show instances for GHC internals

2015-10-19 Thread Alan & Kim Zimmerman
This is a utility I would love to see inside the ghc source tree for examining the AST https://github.com/edsko/ghc-dump-tree Alan On Mon, Oct 19, 2015 at 11:18 PM, Ömer Sinan Ağacan wrote: > Currently the only way to debug and inspect GHC internals is by adding some >

Show instances for GHC internals

2015-10-19 Thread Ömer Sinan Ağacan
Currently the only way to debug and inspect GHC internals is by adding some carefully placed print statements. (I'd love to be proven wrong on this, cost of debugging this way is huge, given how long it's taking to rebuild GHC) We have Outputable instances for most data types, and

Re: Show instances for GHC internals

2015-10-19 Thread Richard Eisenberg
On Oct 19, 2015, at 5:18 PM, Ömer Sinan Ağacan wrote: > cost > of debugging this way is huge, given how long it's taking to rebuild GHC) There are more interesting parts of your post, but I can respond to this: It shouldn't take that much time. Once you have ghc-stage2

Re: Show instances for GHC internals

2015-10-19 Thread Edward Z. Yang
Excerpts from Ömer Sinan Ağacan's message of 2015-10-19 14:18:41 -0700: > I was wondering what would be the cost of adding Show instances. Would that > mean significantly increased compile times? Or significantly bigger GHC > binaries? If that's the case, could we enable Show instances with some >