3 ms·
> It always returns the same result given the same arguments. This is call "referential transparency" and you can add it to your list of five-dollar programming
by username223 13y ago
> It always returns the same result given the same arguments. This is call "referential transparency" and you can add it to your list of five-dollar programming terms.
> It doesn't cause any side effects, e.g. it doesn't "change the external world" by changing external mutable objects or outputting to i/o.
These have little to do with one another. "sort :: [a] -> [a]" sorts a list, perhaps using quicksort. If you want to randomize the pivots, it's "sort :: [a] -> IO [a]", and everything in your program that sorts things has a different type, even though it produces the same value.