yilin.wei10
2020-8-18 19:57:10

Is there a way to define a custom subtyping relation for an opaque type in typed racket?


yilin.wei10
2020-8-18 22:04:02

yilin.wei10
2020-8-18 22:05:59

I guess the solution should just be using a U to represent the supertype and “closing” it and not allowing external modules to extend it?


yilin.wei10
2020-8-19 00:48:52

OK - I’ve found the docs for the define-new-subtype and the Distinction construct.


yilin.wei10
2020-8-19 00:51:02

Or possibly, using a Refinement .