#4359: Implement lambda-case/lambda-if
---------------------------------+------------------------------------------
Reporter: batterseapower | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 7.4.1
Component: Compiler | Version: 7.1
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Comment(by simonpj):
It's true that the proposal we outline above is monolithic in the sense
that it's not composed of smaller parts. But it is particularly simple in
another way: every part of GHC from the parser onwards already implements
lambda-case! The matching part of a lambda, of a case expression, and of
a multi-case function definition, are all defined using a `MatchGroup`
(see `HsExpr.lhs`). All that lambda-case does is provide concrete syntax
to let you get at the abstract syntax that is already there. So it just
"fills the gap" as it were.
A more compositional approach to pattern matching is indeed an interesting
topic. There have been a number of approaches propoed including yours.
(Barry Jay's book is a more radical take on the subject.) But there isn't
a clear winner yet.
So I think lambda-case is a fine candidate to fill the syntactic gap for
now, leaving something more ambitious for the future.
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4359#comment:35>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs