[darcs-devel] [patch2166] cleaning up Arbitrary instances
bugs at darcs.net
Fri Jun 4 07:19:05 UTC 2021
Ben Franksen <ben.franksen at online.de> added the comment:
Right, so the specialization for prim pairs means we can't generalize
such an implementation of pairs to triples. Indeed, aPrimPair can only
work if the types coincide.
On the other hand we have a generic implementation, where we generate
both members of the pair independently, and such an implementation can
always be generalized to two different types (provided they have the
same state type i.e. ModelOf). For instance we use that when generating
FLs of patches.
This suggests that we may want to use the Pair type *only* when we
expect a specialized implementation, and perhaps similarly with Triple.
Whereas for the cases where we chose elements independently, a single
generic instance for (:>) with (possibly) different type variables for
lhs and rhs should suffice.
Darcs bug tracker <bugs at darcs.net>
More information about the darcs-devel