On Mon, 19 Sep 2005, Andrew Pimlott wrote:
On Sat, Sep 17, 2005 at 06:56:36PM +0100, Ben Rudiak-Gould wrote:
* The new syntax is really nice as a replacement for the annoyingly
common x - foo ; case x of... idiom that I've always disliked.
I might wish for case of to mean \x - case
Donn Cave schrieb:
The ordinary lambda comes close - in ghc anyway, it supports
pattern matching. But I can't work out the syntax for multiple
cases, which would obviously be needed to make it practically
useful.
e.g., this seems to be OK:
getArgs = \ (a:_) - putStrLn (show a)
but
On Tue, 2005-09-20 at 10:14 +0200, Sven Moritz Hallberg wrote:
Donn Cave schrieb:
The ordinary lambda comes close - in ghc anyway, it supports
pattern matching. But I can't work out the syntax for multiple
cases, which would obviously be needed to make it practically
useful.
e.g.,
On Tue, 20 Sep 2005, Bernard Pope wrote:
On Tue, 2005-09-20 at 10:14 +0200, Sven Moritz Hallberg wrote:
Donn Cave schrieb:
...
but how do you write
getArgs = \ [] - putStrLn (no arguments)
(a:_) - putStrLn (show a)
What about good old let?
main
= getArgs
On Sat, Sep 17, 2005 at 06:56:36PM +0100, Ben Rudiak-Gould wrote:
* The new syntax is really nice as a replacement for the annoyingly
common x - foo ; case x of... idiom that I've always disliked.
I might wish for case of to mean \x - case x of:
foo = case of ...
Useful outside of
On Mon, 19 Sep 2005, Andrew Pimlott wrote:
On Sat, Sep 17, 2005 at 06:56:36PM +0100, Ben Rudiak-Gould wrote:
* The new syntax is really nice as a replacement for the annoyingly
common x - foo ; case x of... idiom that I've always disliked.
I might wish for case of to mean \x - case x
On Mon, Sep 19, 2005 at 02:17:42PM -0700, Andrew Pimlott wrote:
On Sat, Sep 17, 2005 at 06:56:36PM +0100, Ben Rudiak-Gould wrote:
* The new syntax is really nice as a replacement for the annoyingly
common x - foo ; case x of... idiom that I've always disliked.
I might wish for case