How do functional languages handle random numbers?

Posted by Electric Coffee on Programmers See other posts from Programmers or by Electric Coffee
Published on 2013-06-27T09:42:24Z Indexed on 2013/06/27 10:29 UTC
Read the original article Hit count: 353

What I mean about that is that in nearly every tutorial I've read about functional languages, is that one of the great things about functions, is that if you call a function with the same parameters twice, you'll always end up with the same result.

How on earth do you then make a function that takes a seed as a parameter, and then returns a random number based on that seed?

I mean this would seem to go against one of the things that are so good about functions, right? Or am I completely missing something here?

© Programmers or respective owner

Related posts about functional-programming

Related posts about functions