From: Olivier Andrieu <oandrieu@nerim.net>
To: Christophe Raffalli <raffalli@univ-savoie.fr>
Cc: Christophe Papazian <christophe.papazian@gmail.com>, caml-list@inria.fr
Subject: Re: [Caml-list] covariance newb question
Date: Mon, 28 Nov 2005 08:09:38 +0100 [thread overview]
Message-ID: <17290.44338.301364.710291@karryall.dnsalias.org> (raw)
In-Reply-To: <438A41B5.3060206@univ-savoie.fr>
Christophe Raffalli [Monday 28 November 2005] :
> first 'a -> 'b is covariant in 'a and contravariant in 'b and Ocaml
It's the opposite (contravariant in 'a, covariant in 'b) :
,----
| # type (+'a, -'b) t = 'a -> 'b ;;
| Characters 5-28:
| type (+'a, -'b) t = 'a -> 'b ;;
| ^^^^^^^^^^^^^^^^^^^^^^^
| In this definition, expected parameter variances are not satisfied.
| The 1st type parameter was expected to be covariant,
| but it is contravariant
| # type (-'a, +'b) t = 'a -> 'b ;;
| type ('a, 'b) t = 'a -> 'b
`----
--
Olivier
prev parent reply other threads:[~2005-11-28 7:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-22 11:37 Christophe Papazian
2005-11-23 12:16 ` [Caml-list] " Keiko Nakata
2005-11-27 23:31 ` Christophe Raffalli
2005-11-28 7:09 ` Olivier Andrieu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17290.44338.301364.710291@karryall.dnsalias.org \
--to=oandrieu@nerim.net \
--cc=caml-list@inria.fr \
--cc=christophe.papazian@gmail.com \
--cc=raffalli@univ-savoie.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox