surjective is useful when adding a new constructor to a sum type, but what about adding a new field to a product type? We can't use a separate covers call for each field, because the pattern MyConstructor { myField = _ } covers the entirety of MyConstructor {..}, not just the explicitly-named fields.
surjective
is useful when adding a new constructor to a sum type, but what about adding a new field to a product type? We can't use a separatecovers
call for each field, because the patternMyConstructor { myField = _ }
covers the entirety ofMyConstructor {..}
, not just the explicitly-named fields.