[GHC] #8325: Pattern guards in anonymous functions
GHC
ghc-devs at haskell.org
Wed Sep 18 04:53:35 CEST 2013
#8325: Pattern guards in anonymous functions
------------------------------------+-------------------------------------
Reporter: mcollis | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.6.3
Keywords: | Operating System: Unknown/Multiple
Architecture: Unknown/Multiple | Type of failure: None/Unknown
Difficulty: Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: |
------------------------------------+-------------------------------------
In the course of a project, I had an idea that would allow less cumbersome
use of cases in anonymous functions. Here's a simple example of what I'm
proposing:
{{{
(\x y | x > y -> x
| otherwise -> something else)
}}}
Currently, the only way to accomplish this is with if() then ... else
syntax or the use of the MultiWayIf and LambdaCase extensions. The syntax
I've proposed here matches with existing anonymous function syntax and
doesn't conflict with any other GHC syntax. This would greatly improve the
readability of complex anonymous functions.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8325>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list