[nhc-users] Data nodes

Arunkumar S Jadhav arunk at it.iitb.ac.in
Thu Mar 3 08:02:04 EST 2005


Hello,

As per my understanding following hold true about macroes for
data nodes.

CONSTR(e, s, ws): This is used to construct header for the data nodes
	which contain more than one constructors e.g List, Tree etc

CONSTRW(s, e) and CONSTRP(s, e) : Are used to construct header for
	data nodes which contain single constructor e.g Pair.

I just wrote a program :
----------------------------------
data MyPair a = ThisPair a a a

selectThird (ThisPair 1 x y) = ThisPair 1 1 1
selectThird (ThisPair _ _ y) = ThisPair y y y
------------------------------------

When I saw the corresponding bytecode, I saw (To my surprize)
CONSTR(0, 3, 0) being used to construct the data node in 
the function selectThird (i.e "ThisPair 1 1 1" etc).

What is happening here ? If this is the case, then when exactly are the
meaning of CONSTR() and CONSTRW(), CONSTRP()

Regards,
------------------------------------
Arunkumar S Jadhav, Masters Student, 
KReSIT, IIT-Bombay, India
Ph: +91-22-25764967
http://www.it.iitb.ac.in/~arunk
------------------------------------
I exist because I work.


More information about the Nhc-users mailing list