Re: Fw: Modification of State Transformer

2002-08-12 Thread Shawn P. Garbett
-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 f

Fw: Modification of State Transformer

2002-08-12 Thread Scott J.
- 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

Re: Modification of State Transformer

2002-08-12 Thread Shawn P. Garbett
-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

Re: Modification of State Transformer

2002-08-11 Thread Scott J.
ast" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> 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.or

Re: Modification of State Transformer

2002-08-08 Thread Shawn P. Garbett
> Btw: This has already been done, in GHC: see the ST module in GHC's > library > . 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

Re: Modification of State Transformer

2002-08-08 Thread Jon Cast
"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

Re: Modification of State Transformer

2002-08-08 Thread Ken Shan
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 http://www.digitas.harvard.edu/cgi-bin/ke

Modification of State Transformer

2002-08-08 Thread Tom Pledger
Tom Pledger writes: | Shawn P. Garbett writes: : | | Inferred kind: (* -> * -> *) -> * : | In turn, s corresponds to the third * in the inferred kind in the | error message. Oops! Sorry, the third * is the result of applying St to two types. The second of those two types, s, corre

Modification of State Transformer

2002-08-08 Thread Tom Pledger
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 = Mk