Browse thread
covariance newb question
- Christophe Papazian
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Christophe Papazian <christophe.papazian@g...> |
| Subject: | covariance newb question |
# type +'a t = 'a -> 'a;; In this definition, expected parameter variances are not satisfied. The 1st type parameter was expected to be covariant, but it is invariant But type t seems to be covariant : # let f : 'a t = (fun x -> x);; val f : 'a t = <fun> # let g : int t = f;; val g : int t = <fun> Is there something wrong in my thought ? thank you, Christophe Papazian