[Haskell-cafe] IO () and IO [()]

Luke Palmer lrpalmer at gmail.com
Mon Mar 10 19:50:38 EDT 2008

2008/3/10 Krzysztof Skrzętnicki <gtener at gmail.com>:
> 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


More information about the Haskell-Cafe mailing list