Opened 15 months ago

Last modified 8 months ago

#8582 new feature request

Record syntax for pattern synonyms

Reported by: cactus Owned by: cactus
Priority: normal Milestone:
Component: Compiler Version:
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: #5144 Blocking:
Related Tickets: Differential Revisions:

Description

Implement syntax for

pattern Cons{car, cdr} = (car, cdr)

which can then be used just like a regular record constructor, so the following are all valid patterns:

Cons (Just x) []
Cons{car = Just x}

Change History (1)

comment:1 Changed 8 months ago by cactus

Now that I am parsing pattern synonym declarations using the pattern parser (using the same trick as used by the data constructor parser), and typechecking a pattern synonym can add deferred bindings, this should at least be somewhat simpler to implement.

Note: See TracTickets for help on using tickets.