jackfirth / rebellion

A collection of core libraries for Racket
https://pkgs.racket-lang.org/package/rebellion
Apache License 2.0
80 stars 16 forks source link

Add data type guards #513

Open eutro opened 2 years ago

eutro commented 2 years ago

Adds #:guard-maker arguments for tuple, wrapper and record types, as well as <type>-guard-maker/c macros for creating these from contracts.

Since these are all implemented in terms of just the tuple type and its guard implementation, and is also somewhat repetitive, I believe it makes most sense to have all of these in a single PR.

Implements #42, and its subtasks: #202, #203, #204.

Supercedes #512. and the same caveat applies for the <type>-guard-maker/c macros: they may not be the best for applying contracts, since the calling party is not known to the guard procedure, and thus it has to take any blame for contract violations itself.

eutro commented 2 years ago

I think all of the @racket-referenced identitiers are bound, at least, building the docs doesn't cause any errors with them.

jmhimara commented 1 year ago

Just stumbled onto this and just wandering what the status is? It would be a nice feature to have.