Re: [Haskell-cafe] ST Monad - what's wrong?

2007-12-09 Thread Stefan O'Rear
On Sun, Dec 09, 2007 at 12:11:42PM +0100, Nicu Ionita wrote: > Hi, > > I'm trying to use the ST monad in order to turn an almost pure function into > a pure one: reading a precalculated list of primes into a prime set. But the > following code brings an error: > > > primes :: Set Integer > > prim

Re: [Haskell-cafe] ST Monad - what's wrong?

2007-12-09 Thread Alfonso Acosta
> True. However, note that the release notes of 6.8.1 encourage not to > rely in this "new feature" because it can change in the feature. > I obviously meant in the future, sorry. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.

Re: [Haskell-cafe] ST Monad - what's wrong?

2007-12-09 Thread Alfonso Acosta
On Dec 9, 2007 2:39 PM, pepe <[EMAIL PROTECTED]> wrote: > The typechecker in 6.6.1 gets confused by the ($) and loses track of > the 'freeness' of s (the thread variable) . The same code should work > fine in 6.8.1, or alternatively in 6.6.1 without the ($). True. However, note that the release no

Re: [Haskell-cafe] ST Monad - what's wrong?

2007-12-09 Thread pepe
The typechecker in 6.6.1 gets confused by the ($) and loses track of the 'freeness' of s (the thread variable) . The same code should work fine in 6.8.1, or alternatively in 6.6.1 without the ($). Cheers pepe On 09/12/2007, at 12:11, Nicu Ionita wrote: Hi, I'm trying to use the ST monad

[Haskell-cafe] ST Monad - what's wrong?

2007-12-09 Thread Nicu Ionita
Hi, I'm trying to use the ST monad in order to turn an almost pure function into a pure one: reading a precalculated list of primes into a prime set. But the following code brings an error: > primes :: Set Integer > primes = runST $ getPrimes "primes10h7.txt" > getPrimes :: String -> (forall s.

[Haskell-cafe] ST monad

2006-01-03 Thread oleg
Bulat Ziganshin wrote: the following code can't go through typechecking > import Control.Monad.ST > import Data.Array.ST > main = print $ runST $ >do arr <- newArray (1,10) 127 > a <- readArray arr 1 > writeArray arr 1 216 > b <- readArray arr

RE: [Haskell-cafe] ST monad

2006-01-03 Thread Ralf Lammel
PROTECTED] On Behalf Of Bulat Ziganshin > Sent: Tuesday, January 03, 2006 2:28 AM > To: haskell-cafe@haskell.org > Subject: [Haskell-cafe] ST monad > > Hello > > the following code can't go through typechecking. can anyone help me > to fix it or, better, let me know

[Haskell-cafe] ST monad

2006-01-03 Thread Bulat Ziganshin
Hello the following code can't go through typechecking. can anyone help me to fix it or, better, let me know what i need to read to fix it myself? :) import Control.Monad.ST import Data.Array.ST main = print $ runST $ do arr <- newArray (1,10) 127 a <- readArray arr 1