patch applied (ghc): Fix an nasty black hole,
concerning computation of isRecursiveTyCon
Simon Peyton Jones
simonpj at microsoft.com
Mon Mar 30 04:56:49 EDT 2009
Mon Mar 30 01:49:12 PDT 2009 simonpj at microsoft.com
* Fix an nasty black hole, concerning computation of isRecursiveTyCon
Fixing #246 (pattern-match order in record patterns) made GHC go into
a black hole, by changing the order of patterm matching in
TyCon.isProductTyCon! It turned out that GHC had been avoiding the
black hole only by the narrowest of margins up to now!
The black hole concerned the computation of which type constructors
are recursive, in TcTyDecls.calcRecFlags. We now refrain from using
isProductTyCon there, since it triggers the black hole (very
indirectly). See the "YUK YUK" comment in the body of calcRecFlags.
As it turns out, the fact that TyCon.isProductTyCon matched on the
algTcRec field was quite redundant, so I removed that too. However,
without the fix to calcRecFlags, this wouldn't fix the black hole
because of the use of isRecursiveTyCon in BuildTyCl.mkNewTyConRhs.
Anyway, it's fine now.
M ./compiler/typecheck/TcTyDecls.lhs -5 +13
M ./compiler/types/TyCon.lhs -1 +1
View patch online:
More information about the Cvs-ghc