# How do I add types to these wrapped function in Typed Racket?

**URL:** <https://racket.discourse.group/t/how-do-i-add-types-to-these-wrapped-function-in-typed-racket/783>\
**Category:** Questions & Answers\
**Tags:** question\
**Created:** [March 11, 2022, 4:19am UTC](https://racket.discourse.group/t/how-do-i-add-types-to-these-wrapped-function-in-typed-racket/783 "2022-03-11T04:19:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Decabytes](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/decabytes/32/54_2.png) [@Decabytes](https://racket.discourse.group/u/Decabytes)\
**Post date:** [March 11, 2022, 4:19am UTC](https://racket.discourse.group/t/how-do-i-add-types-to-these-wrapped-function-in-typed-racket/783/1 "2022-03-11T04:19:20Z")

</div>

I was adding types to a library and I ran into some ctypes I'm unsure how to annotate. They are

```scheme
(_fun -> _pointer)
(_fun -> _double)

```

Does the pointer get wrapped as a integer, and the double a float? What if I need to restrict numbers to a specific range like -128 to 127 as in a signed char?  
Unfortunately my foray into this has also caused me to run into [this issue on git](https://github.com/racket/typed-racket/issues/766) so I might have to abandon adding types to the structs.

Did some more digging in the docs and for \_double it looks like [Float/Flonum](https://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types..rkt%29._.Flonum%29%29) is double precision by default so it should be used here.

> Includes Racket’s double-precision (default) floating-point numbers and corresponds to the flonum? predicate. This type excludes single-precision floating-point numbers.

@SamPhillips helped me figure out the pointer one. An opaque type is the most appropriate in this situation.

```scheme
(require/typed ffi/unsafe [#:opaque Pointer cpointer?])

```
