We're going to make a monad called Result
. First, define it as a type. This
definition makes it essentially an enum which is generic over two types.
It can either be Success
containing a value of the first type, or Error
containing a value of the second type.
data Result a e