Zilliqa / scilla

Scilla - A Smart Contract Intermediate Level Language
https://scilla-lang.org
GNU General Public License v3.0
241 stars 78 forks source link

Make `ScillaIdentifier` module `Comparable` #1149

Closed jubnzv closed 1 year ago

jubnzv commented 2 years ago

The ScillaIdentifier module is often used as a key of Map and Set collections, so it must implement functions defined in the Comparable functor. Because of this we create an extra wrapper module in every of this cases, for example here.

It will be convenient to implement Comparable functions once in the ScillaIdentifier and just use it when needed.

anton-trunov commented 2 years ago

Since identifiers contain extra information, like locations, we should decide if the Comparable implementation should just ignore that part.

anton-trunov commented 2 years ago

There is some attempts to implement something like this here: https://github.com/Zilliqa/scilla/blob/55f1b64dba4db9096acea243e0e71aaa3029d3aa/src/base/Type.ml#L89

jjcnn commented 2 years ago

Moving to Scilla 0.14.0.