Re: Prefix form of unboxed tuple

2007-07-06 Thread Neil Mitchell
Hi No real reason why not. If you write foo :: a -> b -> (# a,b #) foo x y = (# x, y #) then foo should work just fine. So what you want needs two things: Do add a feature request if you like. (And/or implement it!) It'd be a good "rounding out" thing. Another feature I'd like is for unb

RE: Prefix form of unboxed tuple

2007-07-06 Thread Simon Peyton-Jones
| You might expect there to be a prefix form of the unboxed tuple: | | Prelude> case (#,#) 1 2 of (# a , b #) -> error $ show (a,b) | :1:7: parse error on input `,' | | But there isn't. No real reason why not. If you write foo :: a -> b -> (# a,b #) foo x y = (# x, y #) then foo should work jus

Re: Prefix form of unboxed tuple

2007-07-06 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 John Meacham wrote: > On Fri, Jul 06, 2007 at 11:26:00AM +0100, Neil Mitchell wrote: >> ghci -fglasgow-exts >> Prelude> case (# 1 , 2 #) of (# a , b #) -> error $ show (a,b) >> *** Exception: (1,2) >> >> You might expect there to be a prefix form of th

Re: Prefix form of unboxed tuple

2007-07-06 Thread John Meacham
On Fri, Jul 06, 2007 at 11:26:00AM +0100, Neil Mitchell wrote: > ghci -fglasgow-exts > Prelude> case (# 1 , 2 #) of (# a , b #) -> error $ show (a,b) > *** Exception: (1,2) > > You might expect there to be a prefix form of the unboxed tuple: > > Prelude> case (#,#) 1 2 of (# a , b #) -> error $ s