| ▲ | pchiusano 4 hours ago | |
Yes, we have a way of hashing literally all values in the language, including arbitrary data types, functions, continuations, etc. For instance, here, I'm hashing a lambda function:[1]
The test result cache is basically keyed by the hash of the expression, and then the test result itself (passed or failed, with text detail).We only do this caching for pure tests (which are deterministic and don't need to be re-run over and over), enforced by the type system. You can have regular I/O tests as well, and these are run every time. Projects typically have a mix of both kinds of tests. It is true that you can only hash things which are "closed" / have no free variables. You might instead hash a function which takes its free variables as parameters. Overall I think Unison would be a nice implementation language for really anything that needs to make interesting use of hashing, since it's just there and always available. [1]: https://share.unison-lang.org/@unison/base/code/releases/7.4... [2]: https://share.unison-lang.org/@unison/base/code/releases/7.4... | ||