Re: [Haskell] ST vs State

2007-05-30 Thread David Menendez
David Menendez writes: > It's also possible to write ST in terms of State. > > Assume we have a Store ADT with this interface: > > data Store r > data STRef r a > withStore :: (forall r. Store r -> a) -> a > newRef:: a -> Store r -> (STRef r a, Store r) > readRef :: ST

Re: [Haskell] ST vs State

2007-05-30 Thread David Menendez
Federico Squartini writes: > Hello dear Haskellers, > > Could someone be kind and explain with some detail what are the > differences between the two monads: > > Control.Monad.ST > And > Control.Monad.State > ? > > They are both meant to model stateful computation but they are not the > same mo

[Haskell] ANNOUNCE: xmonad 0.2

2007-05-30 Thread Spencer Janssen
The xmonad dev team is pleased to announce the 0.2 release of: xmonad: a tiling window manager http://xmonad.org About: Xmonad is a tiling window manager for X. Windows are arranged automatically to tile the screen without gaps or overlap, maximisin

Re: [Haskell] ANNOUNCE: The Reduceron

2007-05-30 Thread Donald Bruce Stewart
mfn-haskell: > Dear Haskellers, > > You may be interested in the Reduceron: > > http://www-users.cs.york.ac.uk/~mfn/reduceron/index.html > > Here is a flavour: > > "The Reduceron is a processor for executing Haskell programs on FPGA > with the aim of exploring how custom architectural feature

[Haskell] ANNOUNCE: Haskell Communities & Activities Report (12th ed., May 2007)

2007-05-30 Thread Andres Loeh
On behalf of the many, many contributors, I am pleased to announce that the Haskell Communities and Activities Report (12th edition, May 2007) http://www.haskell.org/communities/ is now available from the Haskell Communities home page in sev

[Haskell] ANNOUNCE: The Reduceron

2007-05-30 Thread Matthew Naylor
Dear Haskellers, You may be interested in the Reduceron: http://www-users.cs.york.ac.uk/~mfn/reduceron/index.html Here is a flavour: "The Reduceron is a processor for executing Haskell programs on FPGA with the aim of exploring how custom architectural features can improve the speed in which

Re: [Haskell] ST vs State

2007-05-30 Thread Brandon S. Allbery KF8NH
On May 30, 2007, at 5:59 , Federico Squartini wrote: I suppose there is something "under the hood" which makes them different, but I cannot figure out what. For one thing, ST uses existential types to prevent values from leaking outside the monad. -- brandon s. allbery [solaris,freebsd,pe

Re: [Haskell] ST vs State

2007-05-30 Thread Joel Koerwer
Hi Frederico, I had the exact same problem when I first started with Haskell. Quite simply, State uses get/put to handle passing state, whereas ST uses STRefs and STArrays. In State s a, the s has meaning, for example it could be a random number generator or key-value mapping you want to pass a

Re: [Haskell] ST vs State

2007-05-30 Thread Federico Squartini
But they are very similar! At least superficially. They are both based on the notion of state transformer. Moreover in the original paper about the ST monad: http://www.dcs.gla.ac.uk/fp/papers/lazy-functional-state-threads.ps.Z The authors say: "In this paper we describe a way to express statef

Re: [Haskell] ST vs State

2007-05-30 Thread Donald Bruce Stewart
federico.squartini: > Hello dear Haskellers, > > Could someone be kind and explain with some detail what are the > differences between the two monads: > > Control.Monad.ST > And > Control.Monad.State > ? > > They are both meant to model stateful computation but they are not the > same monad. The

[Haskell] ST vs State

2007-05-30 Thread Federico Squartini
Hello dear Haskellers, Could someone be kind and explain with some detail what are the differences between the two monads: Control.Monad.ST And Control.Monad.State ? They are both meant to model stateful computation but they are not the same monad. The first one represents state with in place u