david.alkire
2018-9-22 19:19:18

Is it possible to make refinement types in typed racket? Say I have a 500x500 pixel square, I want to define snap-to points every 5 pixels. I would like to be able to create a type that is a subtype of Integer instead of having my points be from the set of all integers (or even positive integers). Is it possible to define that a type is a subtype of positive integers and passes a certain predicate test like being divisible by 5 and less than 500?



david.alkire
2018-9-22 20:59:21

@samth that’s terrific. thank you so much for the link