[racket] Is it possible to use contract-profile in Typed Racket?

From: Vincent St-Amour (stamourv at ccs.neu.edu)
Date: Mon Mar 3 20:49:07 EST 2014

I pushed `contract-profile-thunk' a few days ago, to solve precisely
that problem. Since it's a function, it can be `require/typed' (with
type `(-> (-> Any) Any)', for example).

If you're not running from HEAD, you can add its definition to an
untyped file:

    (define (contract-profile-thunk f)
      (contract-profile (f)))

Vincent



At Mon, 3 Mar 2014 20:26:07 -0500,
Greg Hendershott wrote:
> 
> Is it possible to use contract-profile in Typed Racket?
> 
>     #lang typed/racket
>     (define (x)
>       #t)
>     (require contract-profile)
>     (contract-profile (x))
> 
> Gives:
> 
>     ; Type Checker: Error in macro expansion -- insufficient type
> information to typecheck. please add more type annotations
>     ;   in: (contract-profile (x))
> 
> Even though `contract-profile` is syntax not a function I tried:
> 
>     (require/typed contract-profile [contract-profile (Any ... -> Any)])
> 
> but that gives:
> 
>     ; contract-profile: use does not match pattern: (contract-profile body ...)
>     ;   in: contract-profile
> 
> And ditto for `(Any Any ... -> Any)` and `(Any -> Any)`, `(whatever -> Void)`.
> 
> I also checked and there's no typed/contract-profile.
> 
> ?
> 
> Thanks.
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.