3 ms·
If you create a Kitchen monad, you could write it imperatively. Then you can have your functional cake and eat it too. (I couldn't stop myself.)
by greydius 11y ago
If you create a Kitchen monad, you could write it imperatively. Then you can have your functional cake and eat it too. (I couldn't stop myself.)
- tmptmp 11y agoa "kitchen monad" may seem to be a overkill for doing what you (or your mom) may need to bake a small number of cakes for you to consume but bakery monads are what is needed if you want to bake hundreds of thousands of cakes of hundreds of different variations (types) in a manageable manner. FP starts to make (more and obvious) sense there not in the small household kitchen. But even then that is not to say that FP doesn't make sense in a small household kitchen. Only, it is very difficult to make sense of that sense at the smaller scales.
- greydius 11y agoI was just attempting to inject a little humor into the situation while bringing attention to the fact functional and imperative are not necessarily mutually exclusive. In fact, I'm of the opinion that Haskell is the best imperative programming language. It's just really hard to explain why that is the case when the popular sentiment is that monads are scary and impossible to understand. In any case, these threads always devolve into ideological bickering which I try to avoid.