Hi, I have been troubled by a specific design problem for a few days. The problem is as follows:

I have a function `f`

```
struct foo
data::Matrix{Float64}
end
function f(x::foo)
...
end
```

Since `f`

is fairly expensive, I want to memoize its results using `Dict`

. However, changing `x.data`

will not change its hash. In this sense, function `f`

may return wrong results because of memoization.

Any suggestions to resolve this problem?

Since `x.data`

can be very large, I do not want to memoize the results with `x.data`

as keys. The best approach I can think of is to make `x.data`

immutable, which I don’t know how to do.