Agreed. But, there are some functions which may have complex computations but still are idempotent. Eg. Sorting, filtering . All elixir elements being immutable definitely helps.
Thinking further, for example, a function that gets something from db which does not change frequently (a user, maybe) might be a good use case. Definitely saves some good performance. However, after some time the function becomes "unreliable", because the user data is bound to change at some time, right.
So, for the above problem, what if the function was not permanent? Lets call it "Transient function". It expires after some time!! I define a function and decorate with some metadata which specifies whether its execution must be cached. If so how long?. Something like:
cache get_usr ,ttl: 10
def get_usr do: get_from_db
Don't know, if it is even possible. just some crazy thoughts :)