▁Cat " ▁is ▁a ▁sub type ▁of ▁" list ▁of ▁Animal " ▁because ▁the ▁list ▁constructor ▁is ▁cov ari ant . ▁This ▁means ▁that ▁the ▁sub ty ping ▁relation ▁of ▁the ▁simple ▁types ▁are ▁preserved ▁for ▁the ▁complex ▁types . ▁ ▁On ▁the ▁other ▁hand , ▁" function ▁from ▁Animal ▁to ▁String " ▁is ▁a ▁sub type ▁of ▁" function ▁from ▁Cat ▁to ▁String " ▁because ▁the ▁function ▁type ▁constructor ▁is ▁cont rav ari ant ▁in ▁the ▁parameter ▁type . ▁Here ▁the ▁sub ty ping ▁relation ▁of ▁the ▁simple ▁types ▁is ▁revers ed ▁for ▁the ▁complex ▁types . ▁ ▁A ▁programming ▁language ▁designer ▁will ▁consider ▁variance ▁when ▁de vis ing ▁typing ▁rules ▁for ▁language ▁features ▁such ▁as ▁arrays , ▁inheritance , ▁and ▁generic ▁dat at ypes . ▁By ▁making ▁type ▁construct ors ▁cov ari ant ▁or ▁cont rav ari ant ▁instead ▁of ▁invariant , ▁more ▁programs ▁will ▁be ▁accepted ▁as ▁well - ty ped . ▁On ▁the ▁other ▁hand , ▁program mers ▁often ▁find ▁contra var iance ▁un int uit ive , ▁and ▁accur ately ▁tracking ▁variance ▁to ▁avoid ▁runtime ▁type ▁errors ▁can ▁lead ▁to ▁complex ▁typing ▁rules . ▁ ▁In ▁order ▁to ▁keep ▁the ▁type ▁system ▁simple ▁and ▁allow ▁useful ▁programs , ▁a ▁language ▁may ▁treat ▁a ▁type ▁constructor ▁as ▁invariant ▁even ▁if ▁it ▁would ▁be ▁safe ▁to ▁consider ▁it ▁variant , ▁or ▁treat ▁it ▁as ▁cov ari ant ▁even ▁though ▁that ▁could ▁viol ate ▁type ▁safety . ▁ ▁F ormal ▁definition ▁ ▁Within ▁the ▁type ▁system ▁of ▁a ▁programming ▁language ,