Throughout the history of machine learning, we have relied on our knowledge of learning in brains to inform our research on learning in machines. We have taken inspiration directly from reflex action, episodic memory, sparse coding, hierarchical perception, and reinforcement learning and instrumental conditioning, amongst many others. Pain is as fundamental to experience and learning as these other cognitive components, yet pain has so far not been amongst this set. This paper makes the case of the greater study and incorporation of pain in the algorithmic development of learning in artificial agents. We contrast an understanding of action obtained by studying pain, which differs from those we inherited from visual and olfactory understanding, and how the philosophy of pain informs this understanding. We provide three examples of learning unique to the pain system, and then look at some opportunities from the study of pain for machine learning and reinforcement learning.