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
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
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
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
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
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.
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