Subject: Re: covariant and contravariant rules
From: Vassily (vass@cs.washington.edu)
Date: Tue Dec 12 2000 - 05:00:57 PST
I am not sure in what context these terms are mentioned in the paper, but
here is a simple example. Consider the type of a function taking
arguments of types t1...tn and returning result of type tres:
(t1...tn)->tres
Such function type is "covariant" in tres and "contravariant" in t1...tn,
which means that
t1''<=t1'
...
tn''<=tn'
tres'<=tres''
imply
(t1'...tn')->tres' <= (t1''...tn'')->tres''
Or, in other words, the former can be used whenever the latter is allowed.
Does this answer your question?
Vass
On Tue, 12 Dec 2000, Mayur Naik wrote:
> Hello
>
> I came across the terms 'covariant rule' and contravariant rule' in the
> paper 'Typechecking and Modules for Multi-Methods.' Can you please tell
> me what these rules are about or give some reference?
>
> Thanks.
>
> -- Mayur
>
>
This archive was generated by hypermail 2b25 : Tue Dec 12 2000 - 05:01:13 PST