> Date: Fri, 3 Jul 1998 21:27:38 +0200
> From: Hans Aberg <[EMAIL PROTECTED]>
>
> >and the exception monad:
> >
> > M a = Ok a | Error String
> >
> >For the exception monad, we could use instead
> >
> > M a = String -> (a, String)
> >
> >where the string represents an error. If there is an error, the string
> >is non-empty and the value $a$ is not considered.
>
> But if you attempt with the exception monad in the second variation, you
> get a distinctly different behavior, because the exception monad (as in the
> first variation) also says that computations should be terminated. The
> second version is like sending an error message to the terminal but letting
> the computations continue.
You are right. Then when an error is detected, we just have to change
the current value to bottom (or anything stopping the computation) in
the same time to set the error message in the string part.
Regards,
F-Nicola
Francois-Nicola Demers
[EMAIL PROTECTED]
[EMAIL PROTECTED]