crucible-mir
: Remove vestigial ?mirCS
and ?mirLib
implicit params, as well as Monoid
instances for Collection
/CollectionState
/RustModule
#1259
Labels
In #1253, we propose to make
crucible-mir
respect themir-json
schema version. As part of implementing this, it would be convenient to store the version number in the parsedCollection
, as this could be useful to report to the user in various situations. However, there is an obstacle that stands in our way of doing so:Collection
has aMonoid
instance, and it's very unclear how to implementmempty
andmappend
for version numbers. We certainly don't want to conjure up a version number out of thin air inmempty
, and it's unclear how we would combine two different version numbers.Why does
Collection
have aMonoid
instance anyway? It ultimately dates back to an old approach thatcrux-mir
used for translatingCollection
s in commit 12df289. In that approach, one would calltranslateMIR
multiple times and combine the results usingmappend
. However, that approach was removed in commit b0708a0. After that commit, the only time we ever use theMonoid
instance forCollection
is to callmappend (mempty :: Collection) x
. This could just as well be simplified tox
, thereby avoiding the need for theMonoid
instance in the first place.Similarly, we could remove:
Monoid
instances forCollectionState
andRustModule
(which depend on theMonoid Collection
instance, but are similarly unused)?mirCS
and?mirLib
implicit parameters (which are only ever instantiated withmempty
).The text was updated successfully, but these errors were encountered: