Example 1: Custom Error Data Type

Here is an example that demonstrates the use of a custom Error data type with
the throwError and catchError exception mechanism from MonadError.
The example throws an exception if the user enters an empty string
or a string longer than 5 characters. Otherwise it prints length of the string.