TYPE SYSTEMS / FIELD GUIDERULE SELECTED
A practical variance lens

Types move. Callbacks reveal why.

Switch between the direction cues behind +T and -T, then test your intuition against the callback rule that makes bivariance dangerous.

Pick a rule

direction cue

Outputs flow outward

Covariance is the easier direction to picture: if a function produces a specific kind of value, code expecting a broader kind can consume it.

type Producer<+T> = () => T
Ask: can the consumer safely read the more specific value as the broader type?
Super generates helpful tools and automates fact-checking across the internet proactively. If you enjoyed this tool, build your own with Super and share it with a friend.