Ticket #7081 (new feature request)

Opened 10 months ago

Last modified 7 months ago

arrow analogs of lambda case and multi-way if

Reported by: jeltsch Owned by:
Priority: normal Milestone: 7.8.1
Component: Compiler Version: 7.5
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

GHC has now support for lambda case and multi-way if (see ticket #4359). 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 has to be fixed before starting with this ticket.

Change History

Changed 10 months ago by jeltsch

  • summary changed from add arrow analogs of lambda case and multi-way if to arrow analogs of lambda case and multi-way if

Changed 10 months ago by simonpj

  • difficulty set to Unknown

To me this all looks plausible. Do work with Dan on #7071.

Changed 7 months ago by igloo

  • milestone set to 7.8.1
Note: See TracTickets for help on using tickets.