Re-do the arity calculation mechanism again (fix Trac #3959)
authorsimonpj@microsoft.com <unknown>
Fri, 13 Aug 2010 16:11:51 +0000 (16:11 +0000)
committersimonpj@microsoft.com <unknown>
Fri, 13 Aug 2010 16:11:51 +0000 (16:11 +0000)
commit635952097df211953c4bd0456b37eba64c485f60
treeb63549ce3f416b7a259e5392411735538642308a
parent02ec37666737ddca8d59ad4ba89ca8b0f12244e2
Re-do the arity calculation mechanism again (fix Trac #3959)

After rumination, yet again, on the subject of arity calculation,
I have redone what an ArityType is (it's purely internal to the
CoreArity module), and documented it better.  The result should
fix #3959, and I hope the related #3961, #3983.

There is lots of new documentation: in particular
 * Note [ArityType]
   describes the new datatype for arity info

 * Note [State hack and bottoming functions]
   says how bottoming functions are dealt with, particularly
   covering catch# and Trac #3959

I also found I had to be careful not to eta-expand single-method
class constructors; see Note [Newtype classes and eta expansion].
I think this part could be done better, but it works ok.
compiler/coreSyn/CoreArity.lhs
compiler/types/Type.lhs