Record evaluated-ness information correctly for strict constructors
authorsimonpj@microsoft.com <unknown>
Thu, 17 Jan 2008 10:52:56 +0000 (10:52 +0000)
committersimonpj@microsoft.com <unknown>
Thu, 17 Jan 2008 10:52:56 +0000 (10:52 +0000)
commit8e15cfb601a904523a39079aa7c55e729ccbffda
tree9067b0c8d6ea4e92aa0447007edcc4ab2edc4b15
parent25d7f19d1fa3a58931f2fb39f6a63e533fa72ddd
Record evaluated-ness information correctly for strict constructors

The add_evals code in Simplify.simplAlt had bit-rotted.  Example:

  data T a = T !a
  data U a = U !a

  foo :: T a -> U a
  foo (T x) = U x

Here we should not evaluate x before building the U result, because
the x argument of T is already evaluated.

Thanks to Roman for finding this.
compiler/simplCore/SimplEnv.lhs
compiler/simplCore/Simplify.lhs