People get hung up on the terminology, but I’ve found if you don’t use the words functor and monad and just focus on the actual use case, second year college students learning functional programming for the first time can grok this concept.
The way I have found success is to have them write a program first where a monad would be useful, and then ask them to implement it without monads. They will identify the need for a monad themselves, and then you can show them the tool they want. Then they use it to solve the problem, and at that point you start giving them a more rigorous theory.
The way I have found success is to have them write a program first where a monad would be useful, and then ask them to implement it without monads. They will identify the need for a monad themselves, and then you can show them the tool they want. Then they use it to solve the problem, and at that point you start giving them a more rigorous theory.