------------------------------ --------------------------------------- ┌─────┐ ┌────────┐ ┌────────────────────────────┐ ┌──────┐ ┌───────┐ ┌───────────────┐ ┌─────────────────────────┐ ┌────────┐ ┌───────────────┐ │Input│ │Function│ │Pure: Only depends on input.│ │Output│ │Input 2│ │Impure Function│ │Impure: Result can change│ │Output 2│ │Global State/IO│ ├─────┤--├────────┤---├────────────────────────────┤ ├──────┤ ├───────┤---├───────────────┤-- ├─────────────────────────┤ ├────────┤ ├───────────────┤ └─────┘ └────────┘ │ │ └──────┘ └───────┘ └───────────────┘ │ │ └────────┘ └───────────────┘ └────────────────────────────┘ └─────────────────────────┘