▁data ▁structures , ▁or ▁other ▁components ▁( e . g . ▁" string ", ▁" array ▁of ▁float ", ▁" function ▁returning ▁boolean "). ▁The ▁main ▁purpose ▁of ▁a ▁type ▁system ▁is ▁to ▁reduce ▁possibilities ▁for ▁bugs ▁in ▁computer ▁programs ▁by ▁defining ▁interfaces ▁between ▁different ▁parts ▁of ▁a ▁computer ▁program , ▁and ▁then ▁checking ▁that ▁the ▁parts ▁have ▁been ▁connected ▁in ▁a ▁consistent ▁way . ▁This ▁checking ▁can ▁happen ▁stat ically ▁( at ▁compile ▁time ), ▁dynamically ▁( at ▁run ▁time ), ▁or ▁as ▁a ▁combination ▁of ▁both . ▁Type ▁systems ▁have ▁other ▁purposes ▁as ▁well , ▁such ▁as ▁express ing ▁business ▁rules , ▁en abling ▁certain ▁compiler ▁optim izations , ▁allowing ▁for ▁multiple ▁dispatch , ▁providing ▁a ▁form ▁of ▁documentation , ▁etc . ▁ ▁A ▁type ▁system ▁associ ates ▁a ▁type ▁with ▁each ▁computed ▁value ▁and , ▁by ▁exam ining ▁the ▁flow ▁of ▁these ▁values , ▁attempts ▁to ▁ensure ▁or ▁prove ▁that ▁no ▁type ▁errors ▁can ▁occur . ▁The ▁given ▁type ▁system ▁in ▁question ▁determ ines ▁what ▁constit utes ▁a ▁type ▁error , ▁but ▁in ▁general ▁the ▁aim ▁is ▁to ▁prevent ▁operations ▁expecting ▁a ▁certain ▁kind ▁of ▁value ▁from ▁being ▁used ▁with ▁values ▁for ▁which ▁that ▁operation ▁does ▁not ▁make ▁sense ▁( logic ▁errors ). ▁Type ▁systems ▁are ▁often ▁specified ▁as ▁part ▁of ▁programming ▁languages , ▁and ▁built ▁into ▁the ▁interpre ters ▁and ▁comp ilers ▁for ▁them ; ▁although ▁the ▁type ▁system ▁of ▁a ▁language ▁can ▁be ▁extended ▁by ▁optional ▁tools ▁that ▁perform ▁added ▁checks ▁using ▁the ▁language ' s ▁original ▁type