Is there a trick to know which types to specify when importing untyped racket into typed racket?

28 views
Skip to first unread message

Raoul Schorer

unread,
Oct 6, 2019, 8:12:21 PM10/6/19
to Racket Users
Hi,

I would very much like to import the package multimethod into a typed module. Unfortunately, the symbols exported by this module are non-trivial macros (at least to me).
So I would like to know whether there is some kind of technique to know which type to specify for imported symbols with require/typed?
I tried various things to no avail. Will I be forced to check the code expansion and try to check types manually if I want to use the package?

So, in practice:
#lang typed/racket


(require/typed multimethod
                       
[struct ...?]
                       
[define-generic ...?]
                       
[define-instance ...?])

Thanks!
Raoul

Ben Greenman

unread,
Oct 6, 2019, 9:38:47 PM10/6/19
to Racket Users
On 10/6/19, Raoul Schorer <raoul....@gmail.com> wrote:
> Hi,
>
> I would very much like to import the package multimethod
> <https://github.com/lexi-lambda/racket-multimethod/blob/master/multimethod-lib/multimethod/multimethod.rkt>
>
> into a typed module. Unfortunately, the symbols exported by this module are
>
> non-trivial macros (at least to me).
> So I would like to know whether there is some kind of technique to know
> which type to specify for imported symbols with require/typed?
> I tried various things to no avail. Will I be forced to check the code
> expansion and try to check types manually if I want to use the package?

I don't know any alternative to typechecking the expanded code to see
if anything's missing
Reply all
Reply to author
Forward
0 new messages