<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffee" text="#000000">
<br>
In any event, I just finally got around to trying to revise my code
so that I can change the definition of <tt>MONADP</tt>'s <tt>zero</tt>
from <br>
<br>
<tt> val zero : errval -> 'a monad<br>
</tt><br>
to <br>
<br>
<tt> val zero : 'a monad<br>
</tt><br>
and it occurred to me that with the value restriction my version might
actually be the better choice. As it stands it is only possible to
define <tt>zero</tt> in terms of values. Which is mostly okay, except
that the usual eta-expansion trick cannot be applied unless your monad
is implemented as a functional type. <br>
<br>
Therefore I am thinking that it might be good to change the <tt>MONAP_CORE</tt>
signature to be<br>
<br>
<tt>signature MONADP_CORE = sig<br>
include MONAD_CORE<br>
type errval <br>
val zero : errval -> 'a monad<br>
val <|> : 'a monad BinOp.t<br>
end<br>
</tt><br>
and in those cases that where you have no interesting error values one
could just use <tt>MONADP_CORE with type errval = unit</tt>. Of
course, this does mean that in such a case you have to write the
aesthetically less pleasing <tt>zero ()</tt> all over your code. <br>
<pre class="moz-signature" cols="72">--
[Geoff Washburn|<a class="moz-txt-link-abbreviated" href="mailto:geoffw@cis.upenn.edu">geoffw@cis.upenn.edu</a>|<a class="moz-txt-link-freetext" href="http://www.cis.upenn.edu/~geoffw/">http://www.cis.upenn.edu/~geoffw/</a>]
</pre>
</body>
</html>