<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Sorry; my answer is just suggesting doing something standard in ML
module systems, but of course not everyone is already familiar with
such systems!<br>
<br>
I only suggested changing, in the <i>output</i> signature of your
functor, the line<br>
    datatype state st a = State of (st -> S.m (st * a))<br>
to<br>
    con state :: Type -> Type -> Type<br>
<br>
It was actually a mistake on my part to refer to [monad_state].<br>
</body>
</html>