What are ZMZN and ->Z1T in a ghc space profile?

Robert Ennals Robert.Ennals@cl.cam.ac.uk
Fri, 16 Nov 2001 12:30:50 +0000


> > But, to answer your emmediate question:
> > 
> > ZMZM = []  - The list Nil constructor
> > Z1T = ( )  - The 1-tuple constructor
> 
> IIRC, the "1" is the number of commas, so Z1T is the *pair* constructor.

The comments in OccName.lhs say: 

	[copying direct from the file]

	Before		After
	--------------------------
	Trak		Trak
	foo_wib		foozuwib
	>		zg
	>1		zg1
	foo#		foozh
	foo##		foozhzh
	foo##1		foozhzh1
	fooZ		fooZZ	
	:+		ZCzp
	()		Z0T	0-tuple
	(,,,,)		Z5T	5-tuple  
	(# #)           Z1H     unboxed 1-tuple	(note the space)
	(#,,,,#)	Z5H	unboxed 5-tuple
		(NB: There is no Z1T nor Z0H.)

Which, interestingly, says that there is no Z1T, despite sengan having 
supposedly found one.

However it also suggests that, if Z1T did exist, then it would be a 1-tuple.


The code itself backs this up and suggests that the number is the number of 
commas + 1:

maybe_tuple "()" = Just("Z0T")
maybe_tuple ('(' : cs)       = case count_commas (0::Int) cs of
				 (n, ')' : cs) -> Just ('Z' : shows (n+1) "T")
				 other	       -> Nothing
maybe_tuple other    	     = Nothing


Just in case anyone wasn't confused yet :-)



-Rob