How to view higher-order functions and IO-actions from a mathematical perspective?
问题 I am trying to understand functional programming from first principles, yet I am stuck on the interface between the pure functional world and the impure real world that has state and side effects. From a mathematical perspective, what is a function that returns a function? what is a function that returns an IO action (like Haskell's IO type)? To elaborate: In my understanding, a pure function is a map from domain to co-domain. Ultimately, it is a map from some values in computer memory to