[#576] Avoid unnecessary contract conversions
Description
Problem: some code paths in Cleveland repeatedly convert typed contract to untyped and back.
Solution: in two parts:
- Fold the zoo of Cleveland's
*OriginateData
types into a single tagged GADT. - Make Cleveland's internal functions polymorphic in the tag.
The rest kind of falls out from the above automatically with minimal effort -- we just don't convert representations midway, and only do that at the very end before handing off to morley/morley-client.
This additionally does a bit of refactoring, as switching to a tagged GADT makes some old code dealing with open types redundant.
Related issue(s)
Resolves #576 (closed)
✅ Checklist for your Merge Request
Related changes (conditional)
-
Tests (see short guidelines)
-
If I added new functionality, I added tests covering it. -
If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
-
-
Documentation
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.