Assuming that you already have an opaque type for F32Vector
, then you can write the type like this:
(require/typed ffi/vector
[f32vector (Real * -> F32Vector)])
In case you don't have an opaque type yet, you can import that like this:
(require/typed ffi/vector
[#:opaque F32Vector f32vector?])
Of course, you can merge the clauses above into a single require/typed
.
Side note: in the future, Typed Racket will probably also support a ->*
type constructor that matches the notation used for writing contracts (including rest arguments). Also, hopefully we can provide a typed/ffi/vector
along with the other bundled libraries.