id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
5720	Unit unboxed tuple behaving oddly	simonpj		"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 -> (# Bool #)
BUT
	f0 :: a -> b -> (# b #)
}}}
I think this is stupid.  It should be
{{{
	f0 :: a -> (# #)
}}}
But in fact even that type isn’t what you expect (ie the analogue of  `f :: a -> ()` )
Here are the kinds of the type constructors:
{{{
	(,,) :: * -> * -> * -> *
	(,) :: * -> * -> *
	() :: *

	(# ,, #) :: * -> * -> * -> #
	(# , #) :: *  -> * -> #
BUT
	(#  #) :: * -> #
}}}
In both respects unboxed unit tuples are behaving differently to boxed ones. This seems bonkers.  I propose to fix this, but I wanted to check if anyone is relying on the current odd behaviour.


Simon
"	bug	closed	normal		Compiler	7.2.1	fixed			Unknown/Multiple	Unknown/Multiple	None/Unknown	Unknown				
