[Haskell-cafe] Re: Composing functions with runST

2007-01-04 Thread apfelmus
Yitzchak Gale wrote: > Well, it turns out that using Data.Sequence or Data.IntMap > to shuffle a list becomes prohibitive if you might have > more than about 10^5 elements in your list. So in that > case you will need to use a mutable array, and you now > need ST. > [..] > >>> Wouldn't it be nice i

[Haskell-cafe] Re: Composing functions with runST

2007-01-04 Thread apfelmus
Neil Mitchell wrote: > As for beginner issues with rank-2 types, I've been learning Haskell > for years now, and have never felt the need for a rank-2 type. If the > interface for some feature requires rank-2 types I'd call that an > abstraction leak in most cases. It certainly means that you can't

Re: [Haskell-cafe] Re: Composing functions with runST

2007-01-01 Thread David House
On 01/01/07, Yitzchak Gale <[EMAIL PROTECTED]> wrote: It seems that I can't even use STRefs. Something is really wrong here. Prelude Control.Monad.ST Data.STRef> runST $ do {r<-newSTRef 2; readSTRef r} Again, this is due to section 7.4.8 [1] of the GHC user manual, which states that you can't

[Haskell-cafe] Re: Composing functions with runST

2007-01-01 Thread Yitzchak Gale
The plot thickens... It seems that I can't even use STRefs. Something is really wrong here. Prelude Control.Monad.ST Data.STRef> runST $ do {r<-newSTRef 2; readSTRef r} :1:8: Couldn't match expected type `forall s. ST s a' against inferred type `a1 b' In the second argument of `