Turnstile relies on the fact that in Racket, you can have identifier macros [1] which can be expanded in pretty much any location (except binding, naturally). Racket is unique in this regard. Clojure has a mechanism to get roughly the same thing, but it's complicated. [2]
Comments
I would expect you can.
lexilambda created Typed Racket on top of Racket. https://github.com/racket/typed-racket
Another approach, using macro expansion to perform the type checking: https://docs.racket-lang.org/turnstile/
Turnstile relies on the fact that in Racket, you can have identifier macros [1] which can be expanded in pretty much any location (except binding, naturally). Racket is unique in this regard. Clojure has a mechanism to get roughly the same thing, but it's complicated. [2]
1: https://docs.racket-lang.org/guide/pattern-macros.html#%28pa...
2: https://lambdaland.org/files/2024_ecoop_type_tailoring.pdf