Add TyCon.checkRecTc, and use in in typeArity
authorSimon Peyton Jones <simonpj@microsoft.com>
Tue, 28 May 2013 07:56:43 +0000 (08:56 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Thu, 6 Jun 2013 13:29:54 +0000 (14:29 +0100)
commita1a67b58d1fb32ee46809492bb01ac5d3a39d2dd
treee7e7b243392462f18f8b94482f0cd42d79484173
parent62653122f3cf2d48a475cadecc9b4483488c9769
Add TyCon.checkRecTc, and use in in typeArity

This just formalises an abstraction we've been using anyway,
namely to expand "recursive" TyCons until we see them twice.
We weren't doing this in typeArity, and that inconsistency
was leading to a subsequent ASSERT failure, when compiling
Stream.hs, which has a newtype like this

   newtype Stream m a b = Stream (m (Either b (a, Stream m a b)))
compiler/coreSyn/CoreArity.lhs
compiler/typecheck/TcForeign.lhs
compiler/types/Coercion.lhs
compiler/types/FamInstEnv.lhs
compiler/types/TyCon.lhs
compiler/types/Type.lhs