3 ms·
What kinds of properties you have in mind? For example, a lot of times I might have two implementations, a naive one that's slow and simple, and an optimized o
by eru 2y ago
What kinds of properties you have in mind?
For example, a lot of times I might have two implementations, a naive one that's slow and simple, and an optimized one. I can compare the output of both against each other on arbitrary input. That's a simple property that easy to understand, but hard to put in the type system in general.
Similarly, I often have properties that eg the order that input is presented in shouldn't matter, or sometimes you have ways to partition your data 'max(maximum over A, maximum over B)) = maximum(A union B)'. How do you encode that in the type system?
Or you have something like 'for any A and B: (find some optimal solution over A) is worse than (find some optimal solution over (A union B))'. Or you have idempotency like 'f(f(A)) = f(A)'.
These are all easy to understand properties, but not trivial to describe in most type systems.