[Haskell-cafe] Showing the 1 element tuple
stefanor at cox.net
Tue Dec 19 17:51:36 EST 2006
On Tue, Dec 19, 2006 at 10:41:56PM +0000, Neil Mitchell wrote:
> 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
Python uses the syntax (foo,) to denote a singleton tuple (that is an extra
comma at the end); quoting the python tutorial "Ugly, but effective".
More information about the Haskell-Cafe