[Haskell-cafe] Showing the 1 element tuple

Brian Hulley brianh at metamilk.com
Tue Dec 19 18:35:49 EST 2006


Neil Mitchell wrote:
> Hi,
>
> A weird question, what does the 1 element tuple look like?
>
> () -- 0 element tuple
> (,) a b -- 2 element tuple
> (,,) a b c -- 3 element tuple
>
> () a - meaningless
> (a) - a in brackets
>
> GHC has the 1 element unboxed tuple, (# a #), and all the other sizes
> unboxed as well, but how would you visually represent the 1 element
> boxed tuple?

Tuples represent dimensionality therefore a 1-element tuple is just a 
1-dimensional value ie the value itself hence a == (a) == ((a)) == (((a))) 
== ...

Brian.
-- 
http://www.metamilk.com 



More information about the Haskell-Cafe mailing list