Manually write `Eq` instance for Typed instr
Clarification and motivation
Currently we have
instance Eq (Instr inp out) where
i1 == i2 = instrToOps i1 == instrToOps i2
in Michelson.Typed.Convert
. It allowed us not to write a long case
covering each constructor, but it has some drawbacks:
- We have an extra orphan instance and in general I think nobody expects to see this instance in
Convert.hs
.2 - The comparison is not precise: for example, we apparently lose
DOC_ITEM
s. AlsoSeq a (Seq b c)
will be considered equal toSeq (Seq a b) c
, but sometimes we want to distinguish these cases.
At the same time, we can write it manually just once, maintaining it will be easy (Instr
type is quite stable) and I don't see any drawbacks.
Acceptance criteria
instance Eq (Typed.Instr inp out)
is defined in Michelson.Typed.Instr
and compares instructions by patern matching on their constructors.