[Haskell-cafe] SIGPLAN Programming Languages Software Award

Yves Parès limestrael at gmail.com
Fri Jun 10 08:00:11 CEST 2011

Oh yes, having newly been using C++ at work, I realized they were a "big
something" [1] that enabled you, as it were, to do whatever unstructured
unholy type trickery you want, and yes, even making classes A<B> and A<C>
completely different things. (BUT! We could argue over this fact: Isn't it
also one of the purposes of... Type Families? Where the TF Foo :: * -> *,
can yield to datatypes Foo String and Foo Int being completely different and
I was more saying that you could roughly "emulate" Haskell classes in C++
with templates (minus a good type security).

[1] Vernacular, isn't it?

2011/6/10 Richard O'Keefe <ok at cs.otago.ac.nz>

> On 9/06/2011, at 8:02 PM, Yves Parès wrote:
> > Were templates an original feature of C++ or did they appear in a
> revision of the langage ?
> The latter.  "C with classes" did not have multiple inheritance,
> exceptions, or templates.
> Note that C++ templates are *not* the same kind of animal as Eiffel
> generics or Java generics
> or Ada generics or Haskell parametric polymorphism.  The C++ template
> language lets you do
> type-level functional programming, and different instances of a common
> "type constructor" may
> in fact have quite different internal structures.  C++ templates are NOT
> 'merely keywords
> around .. parametric polymorphism', they are a far more dangerous thing.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110610/4d42aba7/attachment.htm>

More information about the Haskell-Cafe mailing list