[Haskell-cafe] OOP'er with (hopefully) trivial questions.....

Tim Chevalier catamorphism at gmail.com
Mon Dec 17 14:15:56 EST 2007


On 12/17/07, Wolfgang Jeltsch <g9ks157k at acme.softbase.org> wrote:
> This is not a generalization of what you talked about.  Why should the tuple
> type be unboxed?  Tuple types are boxed, meaning there is a difference
> between _|_ and (_|_,…,_|_).  If you write
>
>     newtype X = X (A, B, C)
>
> then X doesn't add another level of indirection but the level of indirection
> introduced by the tuple constructor remains, of course.  So you could write
> the above newtype declaration instead of
>
>     data X = X A B C.
>

I interpreted Evan's question as "why can't you have newtypes with
multiple fields?" -- i.e., newtype X = X A B C -- and that's the
question I was answering. But maybe I misunderstood.

Cheers,
Tim

-- 
Tim Chevalier * catamorphism.org * Often in error, never in doubt
"After three days without programming, life becomes meaningless."  --
James Geoffrey


More information about the Haskell-Cafe mailing list