[Prev][Next][Index][Thread]
Calculating Functors
Let + range over all covariant type operators. Let - range over all
contravariant type operators. Now imagine one has a term, fun+, which
calculates for any covariant type operator its associated covariant
functor. The type of fun+ would be:
all F:+. all A:*. all B:*. (A -> B) -> F[A] -> F[B]
Now imagine, similarly, a term, fun-, which calculates for any
contravariant type operator its associated contravariant functor. The
type of fun- would be:
all G:-. all A:*. all B:*. (B -> A) -> G[A] -> G[B]
Question 1. If one had fun+ only, could one construct fun-? Similarly,
could one construct fun+ from fun-?
Question 2. Assuming one has fun+ and fun-, can one construct a term
which calculates a functor for any type operator? That is, a term of
type
all H:* -> *. all A:*. all B:*. (A -> B) -> (B -> A) -> H[A] -> H[B]
Sam Moelius