
10 Mar
2008
10 Mar
'08
7:50 p.m.
2008/3/10 Krzysztof Skrzętnicki
In Python the syntax to create 1-tuple is (element,). Note the ",". It's not the most beautiful but is acceptable.
But that syntax ought to be for tuple sections. Is there a good reason that Haskell doesn't have tuple sections? ("hello", "world") :: (String,String) (,) :: a -> b -> (a,b) ("hello",) :: a -> (String,a) -- I want this (,"hello") :: a -> (a, String) -- this too On an unrelated note, the only time I can recall where I wanted a "Box" data type was when I was doing evil with the garbage collector. Can someone show me an example of when they would use a Box? Not that it's hard to make yourself... data Box a = Box a Luke