Teach :print to not panic when the DataCon for a closure is not exposed by the .hi...
authorPepe Iborra <mnislaih@gmail.com>
Thu, 12 Jul 2007 17:43:23 +0000 (17:43 +0000)
committerPepe Iborra <mnislaih@gmail.com>
Thu, 12 Jul 2007 17:43:23 +0000 (17:43 +0000)
commit876db7eda26b37f988bda8f6da8616b03aa5f810
treed86367ef3a6b3a8b0ded3d66db5a8cc259e796b8
parent834fcf7de73aeb4a3fa4c88dc995ce1b55b78a93
Teach :print to not panic when the DataCon for a closure is not exposed by the .hi file

Previously the behaviour was to panic.
Now it will print an approximated representation,
using the names (enclosed in keys, i.e. "<...>")
and the pointed subterms. Non pointed subterms cannot
be included in this representation:

Prelude> let se = Data.Sequence.fromList (map Just "abc")
Prelude> :eval se
()
Prelude> :p se
se = <Data.Sequence.Deep> (<Data.Sequence.One> (_t1::t)) () (<Data.Sequence.Two> (_t2::t) (_t3::t))
Prelude> :eval _t2
()
Prelude> :p se
se = <Data.Sequence.Deep> (<Data.Sequence.One> (_t4::t1)) () (<Data.Sequence.Two> (Just 'b') (_t5::t1))
Prelude>

This patch also includes some fixes in the pretty printer
for the Term datatype
compiler/ghci/Debugger.hs
compiler/ghci/Linker.lhs
compiler/ghci/RtClosureInspect.hs
compiler/typecheck/TcRnDriver.lhs
compiler/typecheck/TcRnDriver.lhs-boot [deleted file]