Changes between Version 1 and Version 2 of Ticket #10180, comment 1


Ignore:
Timestamp:
Mar 23, 2015 8:58:47 AM (4 years ago)
Author:
simonpj
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #10180, comment 1

    v1 v2  
    1 > Simon, what would you prefer: Should `exprIsBottom e` hold for all `e` where the type is a data type with no constructors, or should the lint check take that into account?
    2 
    3 Very interesting. 
    4  * What program gives rise to `case (x::Void) of {}`?
    5 
    6  * Yes, I think there is a case for making `exprIsBottom` hold for data types with no constructors; after all, such an expression is bound to diverge.
    7 
    8  * A slightly less pervasive change would to to say that an empty `case` is ok on a data type that has an empty set of constructors.  Less pervasive in the sense that it affects this Lint check only, whereas the `exprIsBottom` fix would have broader implications: good ones, I think, but also rare.
     1Sure enough, it trips over this
     2{{{
     3*** Core Lint errors : in result of Simplifier ***
     4libraries/base/Data/Void.hs:66:8: Warning:
     5    [in body of lambda with binder a_a2y6 :: Void]
     6    No alternatives for a case scrutinee not known to diverge for sure: a_a2y6
     7}}}
     8Simon, what would you prefer: Should exprIsBottom e hold for all e where the type is a data type with no constructors, or should the lint check take that into account?