Monads

Ken Shan ken at digitas.harvard.edu
Wed Dec 31 23:39:11 EST 2003


Mark Carroll <mark at chaos.x-philes.com> wrote in article <Pine.LNX.4.58.0312311841030.15190 at niagara.mtbc.internal> in gmane.comp.lang.haskell.cafe:
> Omitting the typeclass bit, I'm trying to write something like
> (s1 -> s2) -> StateT s1 m () -> StateT s2 m a -> StateT s1 m a
> 
> That is, it sequences two StateT computations, providing a way to
> translate from the first's state to the second to keep the chain
> going.

Don't you need a (s2 -> s1) function as well, to translate the final
state back into StateT s1?

-- 
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
GW Bush: And when leaders make the wise and responsible choice, when they 
renounce terror and weapons of mass destruction, as Col. Ghadafi has 
now done, they serve the interest of their own people and they add to 
the security of all nations.  http://www.tmealf.com/survey_form.htm



More information about the Haskell-Cafe mailing list