My (vague and probably wrong) understanding is that when you require a non-typed module in a typed module, you have to supply the types. (If it’s a module you use a lot, might be worth wrapping it in your own typed module.) I have no idea how this applies to macros, especially since ->
is just reordering expressions.
Yep, you’re right! Thanks. I’m not sure how that applies to such macros though, that’s what’s tripping me up :white_frowning_face:
There is https://docs.racket-lang.org/ts-guide/caveats.html#%28part._.Macros_and_compile-time_computation%29\|https://docs.racket-lang.org/ts-guide/caveats.html#%28part._.Macros_and_compile-time_computation%29 but it talks about typed racket macros in untyped racket, not the other round
You’re right, Ben :confused:
@samth are you the “typed/racket” person? I forget
Yes
Do you know where it’s documented or any details about using untyped macros in typed code?
Is it possible to use for/fold/derived
same as in #lang racket
to make a new for form in #lang typed/racket
? Is there some documentation somewhere regarding the interaction with the typechecker?
Basically, I’d like to know how to add types to the example https://docs.racket-lang.org/reference/for.html?q=for%2Ffold%2Fderived#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._for%2Ffold%2Fderived%29%29\|here so that it typechecks, please.
Section 3.1.4 here is a good place to start. https://docs.racket-lang.org/ts-guide/more.html#%28part._.Annotating_.Local_.Binding%29\|https://docs.racket-lang.org/ts-guide/more.html#%28part._.Annotating_.Local_.Binding%29
But in general there isn’t necessarily going to be a way to make arbitrary macros work; I can take a look at threading later but it might be hard.
to my knowledge, Typed Racket currently doesn’t support for/fold/derived
Thank you, Sam! I was able to use ann
to annotate the output of λ~>>
, which is what was giving me trouble it seems. Sadly makes it a bit unwieldy to use…