So Monads are a complicated error-propagation framework that has a harder-to-understand conceptual model and results in longer code compared to Python's exceptions.
Look at any serious program in the C language -- there are enormous amounts of code devoted to error handling.
Look at the problem with Java's checked exceptions. The other day I needed to call a static method reflectively. This is what I ended up with:
// java code to invoke a named method on a named class
String the_class_name;
String the_method_name;
try
{
c = Class.forName(the_class_name);
result = (Value) c.getDeclaredMethod(the_method_name).invoke(null);
}
catch (ClassNotFoundException e)
{
throw(new RuntimeException(e));
}
catch (IllegalAccessException e)
{
throw(new RuntimeException(e));
}
catch (IllegalArgumentException e)
{
throw(new RuntimeException(e));
}
catch (InvocationTargetException e)
{
throw(new RuntimeException(e));
}
catch (NoSuchMethodException e)
{
throw(new RuntimeException(e));
}
catch (SecurityException e)
{
throw(new RuntimeException(e));
}
The point that Python's Exception model gets right, that so many other languages get wrong, is that by default, you want to pass errors to the caller.You don't want to pass errors through the same pipeline that results flow through, since then every joint in the plumbing needs error checking. The very name "exception" is chosen to denote an "extraordinary control flow" specifically for error handling.