Skip to content

arrow analogs of lambda case and multi-way if

GHC has now support for lambda case and multi-way if (see ticket #4359 (closed)). It would be good if arrow variants of these features would be implemented. There are three things that should be considered:

Lambda case expressions should have analog proc expressions where

proc case pat_1 -> cmd_1
          ...
          pat_n -> cmd_n

desugars to

proc fresh -> case fresh of
                  pat_1 -> cmd_1
                  ...
                  pat_n -> cmd_n

Lambda case expressions should also have analog arrow commands where

\ case pat_1 -> cmd_1
       ...
       pat_n -> cmd_n

desugars to

\ fresh -> case fresh of
               pat_1 -> cmd_1
               ...
               pat_n -> cmd_n

Multi-way if expressions should have analog arrow commands where

if | cond_1 -> cmd_1
     ...
     cond_n -> cmd_n

desugars to

case () of
    _ | cond_1 -> cmd_1
      ...
      | cond_n -> cmd_n

Identifiers pat_i, cond_i, and cmd_i denote patterns, boolean expressions, and arrow commands, respectively.

Bug #7071 (closed) has to be fixed before starting with this ticket.

Trac metadata
Trac field Value
Version 7.5
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Edited by Wolfgang Jeltsch
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information