examples using built-in state monad
Konst Sushenko
konsu@microsoft.com
Mon, 26 Feb 2001 13:07:51 -0800
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C0A038.2E1BC689
Content-Type: text/plain;
charset="iso-8859-1"
hello,
in my program i used my own parameterised state transformer monad, which is
well described in literature:
newtype State s m a = ST (s -> m (a,s))
ghc and hugs contain built in implementation of state monad ST.
is it the same thing? the documentation is not clear on that.
if it is the same, is it faster?
also, could someone please recommend any samples that use the built in ST
monad?
thanks
konst
------_=_NextPart_001_01C0A038.2E1BC689
Content-Type: text/html;
charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4208.1700" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=467270221-26022001><FONT face="Courier New"
size=2>hello,</FONT></SPAN></DIV>
<DIV><SPAN class=467270221-26022001><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=467270221-26022001><FONT face="Courier New" size=2>in my
program i used my own parameterised state transformer monad, which is well
described in literature:</FONT></SPAN></DIV>
<DIV><SPAN class=467270221-26022001><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=467270221-26022001><FONT face="Courier New" size=2>newtype
State s m a = ST (s -> m
(a,s))<BR></FONT></SPAN></DIV>
<DIV><SPAN class=467270221-26022001><FONT face="Courier New" size=2>ghc and hugs
contain built in implementation of state monad ST.</FONT></SPAN></DIV>
<DIV><SPAN class=467270221-26022001><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=467270221-26022001><FONT face="Courier New" size=2>is it the
same thing? the documentation is not clear on that.</FONT></SPAN></DIV>
<DIV><SPAN class=467270221-26022001><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=467270221-26022001><FONT face="Courier New" size=2>if it is the
same, is it faster?</FONT></SPAN></DIV>
<DIV><SPAN class=467270221-26022001><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=467270221-26022001><FONT face="Courier New" size=2>also, could
someone please recommend any samples that use the built in ST
monad?</FONT></SPAN></DIV>
<DIV><SPAN class=467270221-26022001><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=467270221-26022001><FONT face="Courier New"
size=2>thanks</FONT></SPAN></DIV>
<DIV><SPAN class=467270221-26022001><FONT face="Courier New"
size=2>konst</FONT></SPAN></DIV></BODY></HTML>
------_=_NextPart_001_01C0A038.2E1BC689--