caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] [Q]: Co(ntra)variance and subtyping?
@ 2001-11-16 19:37 Clemens Hintze
  2001-11-17 14:18 ` Mark Wotton
  2001-11-18 13:34 ` [Caml-list] " Andreas Rossberg
  0 siblings, 2 replies; 34+ messages in thread
From: Clemens Hintze @ 2001-11-16 19:37 UTC (permalink / raw)
  To: caml-list

Hello,

I am already lurking on this list for some days. Now I would like to
introduce myself. To earn my living I am working for a company writing
software in area of transportation automatisation. There we are using
mainly C/C++, PL/SQL, Perl and some other scripting languages.

But programming is not only my business but also my hobby. So I try to
grasp as much different paradigms and languages as I can get. The
imperative and declarative programming (using Prolog) is already known
to me (I have not said 'mastered' ;-).

Now I have thought about learning functional programming. I had a
closer look to OCaml, Haskell and Erlang for ca. two weeks. Although
Haskell has impressed me a lot and nearly won me, I had decided to
begin my first steps in OCaml. Partly due to the fact that the
paradigms I am already comfortable with, are also supported, partly
because of its really nice type inference scheme and modularity
capabilities and last but not least due to the fact, that OCaml offers
very nice compilers and a very comprehensive library to work with.

But where is light, there is also some shadow. I find OCaml a really
complex language -- perhaps more complex than Haskell. But, ey, C++ or
Perl also can hardly be called a simple language, isn't it? And I was
able to gain enough knowledge to use C++ successfully at my daily
work.  So I think complexity should not hinder me :-)

As I have decided to learn OCaml, I am sure that I will have several
questions in future, that I would like to ask here on the list, as I
found comp.lang.functional do not seem very busy with OCaml topics.

Two things I would like to ask you right now:

- What does subtyping exactly mean in OCaml resp. functional
  programming?
- What means covariance and contravariance of types and subtypes?

I have already learned that in OCaml classes are not types like in
C++. So subclasses are not be considered as subtypes. But those
co(ntra)variance thingy?  I have read many messages of that list in
the archive. I have found some messages that deal with those terms. I
have also read the OCaml documentation. I think I've got a feeling
what it could mean, but if I should explain it to others, I would
surely fail, i.e. I would not bet my life that I have understood these
terms ;-)

OTOH, these terms seem to be very important in dealing with OCaml or
functional programming.

So excuse me, if I ask a very stupid question, but I really had not
found any me-convincing answer to this. Google also did not help me
here.

So if you wouldn't mind, please try to explain those terms to me. If
possible with some examples.

Let me thank you all in advance and happy OCaml'ing :-)


Regards,
Clemens.

PS: Sorry, if my english is not flawless, but it is not my
    mother-tongue, and I do not speak french a bit, unfortunately.

--
Clemens Hintze  mailto: c.hintze@gmx.net
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2001-11-22  0:38 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-16 19:37 [Caml-list] [Q]: Co(ntra)variance and subtyping? Clemens Hintze
2001-11-17 14:18 ` Mark Wotton
2001-11-17 14:55   ` Mark Wotton
2001-11-17 17:50   ` [Caml-list] " Clemens Hintze
2001-11-17 23:17     ` Mark Wotton
2001-11-18  9:16       ` Clemens Hintze
2001-11-18 13:18         ` Alain Frisch
2001-11-19  9:54           ` Remi VANICAT
     [not found]       ` <9t7v4d$gij$1@qrnik.zagroda>
2001-11-18 11:57         ` Marcin 'Qrczak' Kowalczyk
2001-11-18 13:34 ` [Caml-list] " Andreas Rossberg
2001-11-18 21:22   ` Pixel
2001-11-19  0:33     ` Jacques Garrigue
2001-11-18 22:35       ` David Gurr
2001-11-19  7:24         ` [Caml-list] " Clemens Hintze
2001-11-19 12:03           ` Markus Mottl
2001-11-19  8:29         ` [Caml-list] " Xavier Leroy
2001-11-19 11:03       ` Alain Frisch
2001-11-20  9:58         ` Didier Remy
2001-11-19 11:14       ` Pixel
2001-11-18 22:30   ` [Caml-list] Re: variance, subtyping and monads... oh, my! james woodyatt
2001-11-19  8:11     ` Francois Pottier
2001-11-19  9:02       ` james woodyatt
2001-11-19  9:58         ` Markus Mottl
2001-11-19 20:47           ` james woodyatt
2001-11-19 12:56       ` Frank Atanassow
2001-11-19 10:39     ` Andreas Rossberg
2001-11-19 12:21       ` Markus Mottl
2001-11-19 13:43         ` [Caml-list] Kylix and OCaml Christophe Raffalli
2001-11-20  2:05           ` Vitaly Lugovsky
2001-11-20  8:51             ` Christophe Raffalli
2001-11-22  1:42               ` Vitaly Lugovsky
2001-11-20 10:00             ` Benjamin Monate
2001-11-20 10:24               ` [Caml-list] [Bug in an interface between C++ and OCAML due to some pointer encapsulation] Sylvain Kerjean
2001-11-20 12:14             ` [Caml-list] Kylix and OCaml Maxence Guesdon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).