Re: Unit unboxed tuples

2012-01-11 Thread Simon Marlow
On 10/01/2012 16:18, Dan Doel wrote: Copying the list, sorry. I have a lot of trouble replying correctly with gmail's interface for some reason. :) On Tue, Jan 10, 2012 at 11:14 AM, Dan Doeldan.d...@gmail.com wrote: On Tue, Jan 10, 2012 at 5:01 AM, Simon Marlowmarlo...@gmail.com wrote: On

Re: Unit unboxed tuples

2012-01-11 Thread Tyson Whitehead
On January 11, 2012 08:41:04 Simon Marlow wrote: On 10/01/2012 16:18, Dan Doel wrote: Does the difference have to do with unboxed types? For instance: foo :: () - Int# foo _ = foo () bar :: () - (# Int# #) bar _ = (# foo () #) baz = case bar () of _ - 5

Re: Unit unboxed tuples

2012-01-11 Thread Dan Doel
On Wed, Jan 11, 2012 at 8:41 AM, Simon Marlow marlo...@gmail.com wrote: On 10/01/2012 16:18, Dan Doel wrote: Copying the list, sorry. I have a lot of trouble replying correctly with gmail's interface for some reason. :) On Tue, Jan 10, 2012 at 11:14 AM, Dan Doeldan.d...@gmail.com  wrote:

Re: Unit unboxed tuples

2012-01-10 Thread Simon Marlow
On 09/01/2012 04:46, wren ng thornton wrote: On 12/23/11 8:34 AM, Simon Peyton-Jones wrote: More uniform! If you the singleton-unboxed-tuple data constructor in source code, as a function, you'd write (\x - (# x #)). In a pattern, or applied, you'd write (# x #). Shouldn't (# T #) be

Re: Unit unboxed tuples

2012-01-10 Thread Tyson Whitehead
On January 8, 2012 23:49:47 wren ng thornton wrote: An alternative is to distinguish, say, (# x #) and its spaceful constructor (# #) from the spaceless (##); and analogously for the boxed tuples, though that introduces confusion about parentheses for boxing vs parentheses for grouping. I

Re: Unit unboxed tuples

2012-01-10 Thread Dan Doel
Copying the list, sorry. I have a lot of trouble replying correctly with gmail's interface for some reason. :) On Tue, Jan 10, 2012 at 11:14 AM, Dan Doel dan.d...@gmail.com wrote: On Tue, Jan 10, 2012 at 5:01 AM, Simon Marlow marlo...@gmail.com wrote: On 09/01/2012 04:46, wren ng thornton

Re: Unit unboxed tuples

2012-01-10 Thread wren ng thornton
On 1/10/12 10:31 AM, Tyson Whitehead wrote: On January 8, 2012 23:49:47 wren ng thornton wrote: An alternative is to distinguish, say, (# x #) and its spaceful constructor (# #) from the spaceless (##); and analogously for the boxed tuples, though that introduces confusion about parentheses for

Re: Unit unboxed tuples

2012-01-08 Thread wren ng thornton
On 12/23/11 8:34 AM, Simon Peyton-Jones wrote: More uniform! If you the singleton-unboxed-tuple data constructor in source code, as a function, you'd write (\x - (# x #)). In a pattern, or applied, you'd write (# x #). Shouldn't (# T #) be identical to T? I know that a putative (T)

Re: Unit unboxed tuples

2012-01-08 Thread wren ng thornton
On 12/23/11 12:57 PM, Tyson Whitehead wrote: On December 23, 2011 09:37:04 Ganesh Sittampalam wrote: On 23/12/2011 13:46, Ian Lynagh wrote: On Fri, Dec 23, 2011 at 01:34:49PM +, Simon Peyton-Jones wrote: Arguments Boxed Unboxed 3 ( , , )(# , , #) 2 ( , )

RE: Unit unboxed tuples

2011-12-28 Thread Simon Peyton-Jones
| Just of out curiosity, what would be a compelling use case for singleton | and unit unboxed tuples? | | For singleton unboxed tuples, any situation where you want to return a | single value but not force its evaluation. This occurs for example | with some low level functions

RE: Unit unboxed tuples

2011-12-28 Thread wagnerdm
Quoting Simon Peyton-Jones simo...@microsoft.com: for example. Singleton unboxed tuples are a perfectly valid data type; it's just that we don't (now) have a name for their constructor. Well, Haskell *does* have a mechanism for giving two different implementations to a particular name...

Re: Unit unboxed tuples

2011-12-25 Thread Stefan Holdermans
Duncan, Just of out curiosity, what would be a compelling use case for singleton and unit unboxed tuples? For singleton unboxed tuples, any situation where you want to return a single value but not force its evaluation. This occurs for example with some low level functions

Re: Unit unboxed tuples

2011-12-24 Thread David Menendez
:                 (,,) :: * - * - * - *                 (,) :: * - * - *                 () :: *                 (# ,, #) :: * - * - * - #                 (# , #) :: *  - * - # BUT                 (#  #) :: * - # Just of out curiosity, what would be a compelling use case for singleton and unit unboxed tuples? For singleton unboxed tuples, any situation where you want

Unit unboxed tuples

2011-12-23 Thread Simon Peyton-Jones
Dear GHC users I've just discovered something very peculiar with unboxed tuples in GHC. f2 x = (# True, False #) f1 x = (# True #) f0 x = (# #) What types do these functions have? f2 :: a - (# Bool, Bool #) f1 :: a

Re: Unit unboxed tuples

2011-12-23 Thread Ian Lynagh
On Fri, Dec 23, 2011 at 12:46:38PM +, Simon Peyton-Jones wrote: Dear GHC users I've just discovered something very peculiar with unboxed tuples in GHC. The problem is that there is no boxed singleton tuple, whereas there is an unboxed singleton tuple, so there is a conflict between the

RE: Unit unboxed tuples

2011-12-23 Thread Simon Peyton-Jones
Message- | From: glasgow-haskell-users-boun...@haskell.org [mailto:glasgow-haskell- | users-boun...@haskell.org] On Behalf Of Ian Lynagh | Sent: 23 December 2011 13:17 | To: glasgow-haskell-users@haskell.org | Subject: Re: Unit unboxed tuples | | On Fri, Dec 23, 2011 at 12:46:38PM +, Simon

Re: Unit unboxed tuples

2011-12-23 Thread Ian Lynagh
On Fri, Dec 23, 2011 at 01:34:49PM +, Simon Peyton-Jones wrote: Arguments Boxed Unboxed 3 ( , , )(# , , #) 2 ( , ) (# , #) 1 0 () (# #) Simple, uniform. Uniform horizontally, but strange vertically!

Re: Unit unboxed tuples

2011-12-23 Thread Ganesh Sittampalam
On 23/12/2011 13:46, Ian Lynagh wrote: On Fri, Dec 23, 2011 at 01:34:49PM +, Simon Peyton-Jones wrote: Arguments Boxed Unboxed 3 ( , , )(# , , #) 2 ( , ) (# , #) 1 0 () (# #) Simple, uniform. Uniform

RE: Unit unboxed tuples

2011-12-23 Thread Simon Peyton-Jones
:37 | To: glasgow-haskell-users@haskell.org | Subject: Re: Unit unboxed tuples | | On 23/12/2011 13:46, Ian Lynagh wrote: | On Fri, Dec 23, 2011 at 01:34:49PM +, Simon Peyton-Jones wrote: | | Arguments Boxed Unboxed | 3 ( , , )(# , , #) | 2

Re: Unit unboxed tuples

2011-12-23 Thread Christian Höner zu Siederdissen
Hi, I have to second that. I recently fell over that problem when writing instances for certain kinds of tuples. In libraries, such as tuple there is a special 'OneTuple' constructor but I'd really appreciate a more uniform fix -- but don't know of one either... Gruss, Christian * Ganesh

Re: Unit unboxed tuples

2011-12-23 Thread Tyson Whitehead
On December 23, 2011 09:37:04 Ganesh Sittampalam wrote: On 23/12/2011 13:46, Ian Lynagh wrote: On Fri, Dec 23, 2011 at 01:34:49PM +, Simon Peyton-Jones wrote: Arguments Boxed Unboxed 3 ( , , )(# , , #) 2 ( , ) (# , #) 1 0 () (#

Re: Unit unboxed tuples

2011-12-23 Thread Stefan Holdermans
would be a compelling use case for singleton and unit unboxed tuples? Cheers, Stefan ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users