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] 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 low high = getStdRandom (randomR

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 in a ticket

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 ought to mean GHC

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

2008-09-18 Thread Lev Walkin
/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 (tried -O2/-O3), or is this indeed a serious problem to tackle? -- Lev Walkin [EMAIL

[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. Thanks for this nice