Re: [Haskell-cafe] unary pattern matching

2006-01-29 Thread John Meacham
On Fri, Jan 27, 2006 at 04:57:14AM -0500, Cale Gibbard wrote: Or if we're going to allow @ as an infix operator, we could use (@ pat), reminiscent of section notation. (exp @) of course would make no sense, seeing as there's no representation for patterns as values. oooh. I like that. what

Re: [Haskell-cafe] unary pattern matching

2006-01-27 Thread Brian Hulley
John Meacham wrote: On Fri, Jan 27, 2006 at 12:28:23PM +1100, Donald Bruce Stewart wrote: john: I have often wanted a shorthand syntax for testing if a value matches a given pattern. I want to implement such an extension for jhc but can't decide an appropriate syntax so I thought I'd ask the

Re: [Haskell-cafe] unary pattern matching

2006-01-27 Thread Cale Gibbard
On 27/01/06, Brian Hulley [EMAIL PROTECTED] wrote: John Meacham wrote: On Fri, Jan 27, 2006 at 12:28:23PM +1100, Donald Bruce Stewart wrote: john: I have often wanted a shorthand syntax for testing if a value matches a given pattern. I want to implement such an extension for jhc but

[Haskell-cafe] unary pattern matching

2006-01-26 Thread John Meacham
I have often wanted a shorthand syntax for testing if a value matches a given pattern. I want to implement such an extension for jhc but can't decide an appropriate syntax so I thought I'd ask the group. basically I want something like /Left (Just _)/ expands to \x - case x of Left

Re: [Haskell-cafe] unary pattern matching

2006-01-26 Thread Taral
On 1/26/06, Donald Bruce Stewart [EMAIL PROTECTED] wrote: Something like pattern guards? f x | Just _ - x = putStrLn something These subsume pattern guards... -- Taral [EMAIL PROTECTED] Computer science is no more about computers than astronomy is about telescopes. -- Edsger Dijkstra