# @deftype and @defpolytype for Scribble

**URL:** <https://racket.discourse.group/t/deftype-and-defpolytype-for-scribble/935>\
**Category:** Questions & Answers\
**Tags:** typed-racket, scribble\
**Created:** [April 29, 2022, 2:43pm UTC](https://racket.discourse.group/t/deftype-and-defpolytype-for-scribble/935 "2022-04-29T14:43:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![scolobb](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/scolobb/32/108_2.png) [@scolobb](https://racket.discourse.group/u/scolobb)\
**Post date:** [April 29, 2022, 2:43pm UTC](https://racket.discourse.group/t/deftype-and-defpolytype-for-scribble/935/1 "2022-04-29T14:43:52Z")

</div>

Hello,

While writing Scribble docs for my Typed Racket code, I ended up with the following macros:

```scheme
@(define-syntax-rule (defpolytype . args)
  (defform #:kind "polymorphic type" . args))

@(define-syntax-rule (deftype . args)
  (defidform #:kind "type" . args))

```

Am I missing some existing definitions in Scribble?

If not, would it be interesting to add these definitions? I am willing to make a PR if people think it makes sense.

---

<div class="post-metadata">

**Author:** ![capfredf](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/capfredf/32/935_2.png) [@capfredf](https://racket.discourse.group/u/capfredf)\
**Post date:** [April 29, 2022, 5:26pm UTC](https://racket.discourse.group/t/deftype-and-defpolytype-for-scribble/935/2 "2022-04-29T17:26:41Z")

</div>

I don't think there are built-in `deftype` and `defpolytype` in scribble. After all, scribble speaks no types 😛 .

IIUC, there is a [deftype](https://github.com/racket/typed-racket/blob/d65ff8bd7146b15b79f31506f8aca410aed196e4/typed-racket-doc/typed-racket/scribblings/utils.rkt#L55) defined for the TR scribble docs.

---

<div class="post-metadata">

**Author:** ![scolobb](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/scolobb/32/108_2.png) [@scolobb](https://racket.discourse.group/u/scolobb)\
**Post date:** [April 29, 2022, 10:05pm UTC](https://racket.discourse.group/t/deftype-and-defpolytype-for-scribble/935/3 "2022-04-29T22:05:49Z")

</div>

Thank you @capfredf, I'll make my definitions the same as in Typed Racket to make things uniform.

In my opinion, it may be relevant to add some of these definitions to Scribble, but I am clearly biased and I have no idea whether it is a good strategy for Scribble or not. After all, these definitions are very easy to write.
