79326045

Date: 2025-01-03 09:46:51
Score: 0.5
Natty:
Report link

Dafny doesn't support operator overloading. However, you can define your own predicates to support ordering on your data type. If you make it a module then you can abstract away the actual ordering comparison as well. Then later when you have a native type that supports those operators you can just supply the implementation of the operations as a module instance.

There was a great blog post with an example, which now I can only find on the wayback machine here

Reasons:
  • No code block (0.5):
Posted by: Hath995