Re: [Haskell-cafe] Random question

2008-09-24 Thread Lev Walkin
forgot return, of course: > myTake :: IO [Int] > myTake = do > n <- rand 1 10 > return $ take n [1..10] Lev Walkin wrote: Iain Barnett wrote: Hi, I have a function, that produces a random number between two given numbers rand :: Int -> Int -> IO Int rand lo

Re: [Haskell-cafe] Random question

2008-09-24 Thread Lev Walkin
Iain Barnett wrote: Hi, I have a function, that produces a random number between two given numbers rand :: Int -> Int -> IO Int rand low high = getStdRandom (randomR (low,high)) (Naively) I'd like to write something like take (rand 1 10 ) [1..10] and see [1,2,3,4] ... or anything but nasty

Re: [Haskell-cafe] Re: XML (HXML) parsing :: fixed GHC 6.8.3 space leak from 2000

2008-09-23 Thread Lev Walkin
This solution seem to provide a practical alternative to pusing datatypes for streaming XML. http://gemo.futurs.inria.fr/events/PLANX2008/papers/p10.pdf Lev Walkin wrote: Marc A. Ziegert wrote: We don't know of a good way to fix this problem. I'm going to record this example i

Re: [Haskell-cafe] Re: XML (HXML) parsing :: GHC 6.8.3 space leak from 2000

2008-09-23 Thread Lev Walkin
tramodular optimizations? -- Lev Walkin finally... there is a way! :D hmm... this was a nice puzzle ;) i've tried several times (and hours!) to implement a Continuation (not monad) based solution, but finally i developed this tricky but elegant foldr solution... i built the parser a

Re: [Haskell-cafe] Re: XML (HXML) parsing :: GHC 6.8.3 space leak from 2000

2008-09-19 Thread Lev Walkin
Lev Walkin wrote: Simon Marlow wrote: Lev Walkin wrote: I wondered why would a contemporary GHC 6.8.3 exhibit such a leak? After all, the technique was known in 2000 (and afir by Wadler in '87) and one would assume Joe English's reference to "most other Haskell systems&quo

[Haskell-cafe] Re: XML (HXML) parsing :: GHC 6.8.3 space leak from 2000

2008-09-18 Thread Lev Walkin
Simon Marlow wrote: Lev Walkin wrote: I wondered why would a contemporary GHC 6.8.3 exhibit such a leak? After all, the technique was known in 2000 (and afir by Wadler in '87) and one would assume Joe English's reference to "most other Haskell systems" ought to mean GHC.

[Haskell-cafe] XML (HXML) parsing :: GHC 6.8.3 space leak from 2000

2008-09-17 Thread Lev Walkin
rom an old Joe's request (circa 2000): http://www.cse.unsw.edu.au/~dons/haskell-1990-2000/msg06086.html but my version is a bit more self-sufficient for the new folks who'd like to quickly test it on their system. Am I really ignorant of some important GHC optimization options (t