[commit: ghc] master: Allow cases with empty alterantives (ac230c5)
Simon Peyton Jones
simonpj at microsoft.com
Wed May 2 16:45:04 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/ac230c5ef652e27f61d954281ae6a3195e1f9970
>---------------------------------------------------------------
commit ac230c5ef652e27f61d954281ae6a3195e1f9970
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Wed May 2 15:44:14 2012 +0100
Allow cases with empty alterantives
This patch allows, for the first time, case expressions with an empty
list of alternatives. Max suggested the idea, and Trac #6067 showed
that it is really quite important.
So I've implemented the idea, fixing #6067. Main changes
* See Note [Empty case alternatives] in CoreSyn
* Various foldr1's become foldrs
* IfaceCase does not record the type of the alternatives.
I added IfaceECase for empty-alternative cases.
* Core Lint does not complain about empty cases
* MkCore.castBottomExpr constructs an empty-alternative case
expression (case e of ty {})
* CoreToStg converts '(case e of {})' to just 'e'
compiler/coreSyn/CoreArity.lhs | 10 +++-
compiler/coreSyn/CoreFVs.lhs | 2 +-
compiler/coreSyn/CoreLint.lhs | 8 ---
compiler/coreSyn/CoreSyn.lhs | 53 ++++++++++++++++++++-
compiler/coreSyn/CoreUnfold.lhs | 4 +-
compiler/coreSyn/MkCore.lhs | 12 ++++-
compiler/iface/BinIface.hs | 7 +++
compiler/iface/IfaceSyn.lhs | 14 +++++-
compiler/iface/MkIface.lhs | 4 +-
compiler/iface/TcIface.lhs | 6 ++
compiler/simplCore/OccurAnal.lhs | 2 +-
compiler/simplCore/SimplCore.lhs | 10 ++--
compiler/simplCore/SimplUtils.lhs | 56 +++++++++++-----------
compiler/simplCore/Simplify.lhs | 93 ++++++++++++++++++------------------
compiler/specialise/SpecConstr.lhs | 4 +-
compiler/specialise/Specialise.lhs | 8 ++--
compiler/stgSyn/CoreToStg.lhs | 12 +++++
compiler/stranal/DmdAnal.lhs | 2 +-
18 files changed, 201 insertions(+), 106 deletions(-)
Diff suppressed because of size. To see it, use:
git show ac230c5ef652e27f61d954281ae6a3195e1f9970
More information about the Cvs-ghc
mailing list