Skip to content
  • Simon Peyton Jones's avatar
    Allow cases with empty alterantives · ac230c5e
    Simon Peyton Jones authored
    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'
    ac230c5e