-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Sunday 11 August 2002 07:26 pm, Scott J. wrote:
Hi,
I invite you then to explain what happens with every step.
The use of forall is misleading and fast to be misunderstood: I mention
here the inner forall's.
Thx
Scott
This list is
- Original Message -
From: Scott J. [EMAIL PROTECTED]
To: Shawn P. Garbett [EMAIL PROTECTED]
Sent: Monday, August 12, 2002 9:04 PM
Subject: Re: Modification of State Transformer
I 'm sorry,
What I meant was discussion about the state transformer ST s a itself. And
how it works
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Monday 12 August 2002 02:08 pm, Scott J. wrote:
- Original Message -
From: Scott J. [EMAIL PROTECTED]
What I meant was discussion about the state transformer ST s a itself.
And how it works. What does mean the second inner forall
]
Sent: Friday, August 09, 2002 3:16 AM
Subject: Re: Modification of State Transformer
Btw: This has already been done, in GHC: see the ST module in GHC's
library
http://www.haskell.org/ghc/docs/latest/html/base/Control.Monad.ST.html.
This list is great. The implementation in the ST module
Shawn P. Garbett writes:
:
| What I want is something like this, so that the state transformer has a
| generic state type:
|
| newtype St a s = MkSt (s - (a, s))
|
| apply :: St a s - s - (a, s)
| apply (MkSt f) s = f s
|
| instance Monad St where
| return x = MkSt
On 2002-08-08T14:11:54-0500, Shawn P. Garbett wrote:
newtype St a s = MkSt (s - (a, s))
instance Monad St where
This line should say
instance Monad (St a) where
because it is (St a) that is a Monad, not St by itself.
--
Edit this signature at
Shawn P. Garbett [EMAIL PROTECTED] wrote:
I'm trying to modify Richard Bird's state transformer. The example
in his book (_Introduction_to_Functional_Programming_using_Haskell_)
has State defined as a explicit type.
I.e. Here's the relevant snippet:
-- State transformer definition
Btw: This has already been done, in GHC: see the ST module in GHC's
library
http://www.haskell.org/ghc/docs/latest/html/base/Control.Monad.ST.html.
This list is great. The implementation in the ST module solves the problem
and I understand how it works.
Shawn
--
You're in a maze of