mietek / epigram2

Mirror of Epigram 2, by Conor McBride, et al.
https://code.google.com/p/epigram
MIT License
48 stars 7 forks source link

"Show" instance on term has a space leak #83

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The space leak reported in 
[http://code.google.com/p/epigram/issues/detail?id=79] can actually be tracked 
down (using profiling) to the a "show" instance in Evidences.Tm.

It is triggered by an error report in Elaboration.MakeElab:

>     handleSchemeArgs es sch ttt as = throwError' . err . unlines $ [
>         "handleSchemeArgs: cannot handle scheme", show sch,
>         "with neutral term", show ttt,
>         "and eliminators", show as]

in an instance of Bug #82.

The ttt thing is sufficiently big/our Show code is sufficiently bad to asplode 
our RAM.

Original issue reported on code.google.com by pedag...@gmail.com on 5 Sep 2010 at 11:47

GoogleCodeExporter commented 9 years ago
This line is not using the error-reporting mechanism properly: it should 
pretty-print terms rather than showing them. I've modified it to do so, but we 
still have space problems in the file from issue 79. 

http://www.e-pig.org/darcsweb/darcsweb?r=Pig09;a=commit;h=20100906105410-e29d1-a
f77b55fa2cdb472e0dc4666fbc31563e448dbec.gz

Original comment by adamgundry on 6 Sep 2010 at 11:59