5 ms·
Because most people suck at taking abstract mathematical concepts and seeing how they could apply to code. Including me. Let's take the definition of a functi
by bcrosby95 5y ago
Because most people suck at taking abstract mathematical concepts and seeing how they could apply to code. Including me. Let's take the definition of a function:
> A function is a relation for which each value from the set the first components of the ordered pairs is associated with exactly one value from the set of second components of the ordered pair.
Cool, I have no idea what the fuck this means and how it is useful to me.
Oh wait, I use them every day.
- siraben 5y agoThat is the first definition stated in first-order logic, sure. But the operational reading of a (computable) function being something that takes in input and produces an output (via some algorithm) is still correct. It is possible to be both clear and correct with operational analogies. However, monads and functors don't readily admit an easy operational reading like functions.
- hiker 5y ago> Cool, I have no idea what the fuck this means and how it is useful to me. > Oh wait, I use them every day. Do you really? Do the `functions` you use even fit the above definition? I bet you can think of infinite number of functions (bool -> bool). The above definition admits only 4 such functions.
- bb010g 5y agoThere are only 4 (2**2) such pure functions. For type (Bool -> IO Bool), there are infinite (∞**2) such pure functions.