[commit: ghc] master: Allow recursive unwrapping of data families (0b7e538)
git at git.haskell.org
git at git.haskell.org
Fri Jun 26 07:32:55 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/0b7e538a09bc958474ec704063eaa08836e9270e/ghc
>---------------------------------------------------------------
commit 0b7e538a09bc958474ec704063eaa08836e9270e
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Wed Jun 24 22:54:27 2015 +0100
Allow recursive unwrapping of data families
When doing strictness analysis, we need to look inside products.
To avoid unpacking infinitely, we must be careful about
infinite types. That in turn is controlled by TyCon.checkRecTc.
For data families like
data instance T (a,b) = MkT a (T b)
we want to unpack the thing recursively for types like
T (Int, (Int, (Int, Int)))
This patch elaborates the checkRecTc mechanism in TyCon, to
maintain a *count* of how many times a TyCon has shown up,
rather than just a boolean.
A simple change, and a useful one. Fixes Trac #10482.
>---------------------------------------------------------------
0b7e538a09bc958474ec704063eaa08836e9270e
compiler/typecheck/FamInst.hs | 43 +++++++++++++++++++++++++------------------
compiler/types/Coercion.hs | 11 ++++++-----
compiler/types/FamInstEnv.hs | 17 ++++++++---------
compiler/types/TyCon.hs | 40 +++++++++++++++++++++++++++++-----------
4 files changed, 68 insertions(+), 43 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 0b7e538a09bc958474ec704063eaa08836e9270e
More information about the ghc-commits
mailing list