Unit unboxed tuples

Simon Peyton-Jones simonpj at microsoft.com
Wed Dec 28 09:53:17 CET 2011


| > 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 in the implementation of ordinary lazy
| arrays.

True; but you don't need the singleton constructor as a function to do that; just write

	f x = (# x+1 #)

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.

Simon


More information about the Glasgow-haskell-users mailing list