I would say this is a bit of a meaningless distinction and that the function is pure. You can always break assumptions if you try hard enough. e.g. in Haskell:
Prelude System.IO.Unsafe System.Random> let sum = foldl (+) 0
Prelude System.IO.Unsafe System.Random> sum [unsafePerformIO randomIO, unsafePerformIO randomIO]
1658109205626070070
Prelude System.IO.Unsafe System.Random> sum [unsafePerformIO randomIO, unsafePerformIO randomIO]
8004505404486503573
Prelude System.IO.Unsafe System.Random> sum [unsafePerformIO randomIO, unsafePerformIO randomIO]
-7400902255149128526
16
u/kpmah Aug 27 '16
I would say this is a bit of a meaningless distinction and that the function is pure. You can always break assumptions if you try hard enough. e.g. in Haskell: