Closed
Description
openedon Feb 20, 2012
There are a lot of optimization opportunities coming from the ability to distinguish pure functions from unpure. The most important one (IMO) is deforestation: when you have something like sum(transpose(transpose(generate_random_matrix(M, N)) * SCALAR))
, you can optimize away an entire matrix construction if you know that sum
consumes matrix, generate_random_matrix
builds one and all functions that was applied to generated matrix are pure. So it would be handy to have an ability to say that the particular function is pure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment