Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Parametric polymorphism gets you subtyping for function types even if you don't have it in general. `forall a . a -> a` is a subtype of `T -> T` for any particular `T`, for instance. And if you don't have subtyping or polymorphism, then talking about "leaving out" co/contravariance doesn't really make sense: there's nothing left to vary.


Nothing left to vary -> no variance -> no co/contravariance.

So... first-class functions with no covariance, contravariance?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: