3 ms·
>>> I literally have never experienced a bug because of the existence of Math.random(). You must be doing something wrong than. :) The world is impure. Preten
by StreamBright 8y ago
>>> I literally have never experienced a bug because of the existence of Math.random().
You must be doing something wrong than. :)
The world is impure. Pretending it is not is just laughable. I am saying this and I am actually writing only functional code for living, but I understand when I cannot solve the problem with functional concepts.
Few example:
- now()
- random()
- runSqlQuery()
- open a file
My code might be 90% pure functions but the rest is mutations, handling non-idempotent things, dealing with state, as the world is.
- yakshaving_jgt 8y ago> The world is impure. Pretending it is not is just laughable. Not a single "pure FP zealot" would argue against this. The fact that you imply this again reveals your ignorance. People who know what they're talking about know that you can't model effectful routines with pure functions. That's why a function that gets the current time, or generates some random number, or talks to a database, or talks to the filesystem, has `IO` in the type signature. I have already demonstrated this to you. Perhaps you have some difficulty with reading. FP folks would never pretend a program that has zero effect on the world is useful.