#haskell - Tue 1 May 2007 between 12:11 and 12:17

NY Lost Funds



sproingie> replicateM 5 $ getStdRandom $ random
lambdabotAdd a type signature
Knuckles12what is the (!!) ?
sproingie> getStdRandom $ runState $ replicateM 5 $ State random
lambdabotAdd a type signature
norpan!! is list indexing
astrolabe@type (!!)
lambdabotforall a. [a] -> Int -> a
Knuckles12thank you
thank you very much
Cheeryheh, somebody owns haskell community's certified crystal ball! :D
Knuckles12didn't know this
sproingie> getStdRandom $ runState $ replicateM 5 $ State random :: IO [Int]
lambdabot<IO [Int]>
sproingiegolly
i take it getStdRandom is expensive?
astrolabesproingie: you can pm lambdabot until you get it right :)
sproingiewell i did, but it doesn't like to print
dolio@src getStdRandom
lambdabotSource not found. Maybe if you used more than just two fingers...
CheeryKnuckles12: you can always ask, just type your question first
Knuckles12I did
sproingielemme rephrase .. i take it repeatedly calling getStdRandom is more expensive than threading the new random seed through in State?
Knuckles12and if i want the other diagonal
how do you do?
quicksilversproingie: it might be expensive, but that's not the main point
sproingie: the main point, is that's daft :)
Knuckles12: I bet you can work that out, given the answer you've already got
Knuckles12: or at least make an attempt
Knuckles12yep
BotjeKnuckles12: something with reverse.
Cheery> [3..0
lambdabotParse error
Knuckles12ok
Cheery> [3..0]
Knuckles12sorry
lambdabot[]
Knuckles12i reverse my list
and i do the same thing
migt work

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 93 100 

IrcArchive

NY Lost Funds