Another bit of code that seems to work is:
convertState :: (s1 - s2)
- (s2 - s1)
- State s2 a
- State s1 a
convertState fromState toState computation =
do oldState - get
let (result, newState) =
runState computation (fromState
On Tue, 2004-01-06 at 22:58, Graham Klyne wrote:
I'm not an expert in this, but I think what you are proposing is possible,
to a point, possibly assuming that your monads have associated functions to
combine and separate the monadic parts.
Thanks for the below illustration of how this
[Reply thread moved to Haskell-cafe]
At 18:19 06/01/04 +1030, Dr Mark H Phillips wrote:
I am still learning about monads. I have a problem
in mind and am wondering whether state monads are
able to solve it. The difficulty is that it would
necessitate the interaction of two state threads
and I'm