Regarding Lifted vs. Unlifted Tuples
------------------------------------
I pretty strongly agree with the general oberservation that "tuples
for free" is a Good Idea, whether it be motivated from ADT's (as Simon
first did), from function results (as Joe did), or as function
arguments/currying (as Phil did). I think HOW we get them is the real
question. I admit that strictness annotations on a single-constructor
data decl are kind of a hack, and I kind of like the notion of having
a separate decl for this purpose (Phil's "newtype" seems best, but I'm
not picky). On the other hand, the following obervation may be worth
considering:
It has occurred to me that unlifted tuples achieved via a special
"newtype" decl are not the same as those achieved with strictness
annotations. This is because with "newtype" it seems that people want
a situation where (_|_,_|_) = _|_. But with strictness annotations on
both arguments a few other things also happen:
(x,_|_) = _|_
(_|_,y) = _|_
where x and y are arbitrary values. This version is obviously less
defined than the other, but has the nice property that it can be an
instance of the class Strict with a SEQUENTIAL method for "seq"
(i.e., parallelism isn't required) that does what is "expected"
(i.e., SOMETHING gets evaluated, despite Joe's excellent attempt
to argue that this isn't what we should expect! :-).
Furthermore, I believe (someone correct me if I'm wrong!) that the
following isomorphisms still hold:
(a,(b,c)) = ((a,b),c) = (a,b,c)
(a,b) -> c = a -> b -> c
-Paul