# Using Treelists in Typed Racket

**URL:** <https://racket.discourse.group/t/using-treelists-in-typed-racket/3478>\
**Category:** General\
**Created:** [January 11, 2025, 1:17am UTC](https://racket.discourse.group/t/using-treelists-in-typed-racket/3478 "2025-01-11T01:17:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbclements](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/jbclements/32/11_2.png) [@jbclements](https://racket.discourse.group/u/jbclements)\
**Post date:** [January 11, 2025, 1:17am UTC](https://racket.discourse.group/t/using-treelists-in-typed-racket/3478/1 "2025-01-11T01:17:22Z")

</div>

Is there existing support for treelists in Typed Racket? I can of course Do It Myself by importing the functions I need with type annotations, but I'm sure I'm not the first one to use treelists with TR! Or maybe this is in nightly and I should stop using 8.15?

(What I tried, none worked: (1) looking for a typed/treelist package, (2) requiring racket/treelist and using Treelist and Treelistof in a type context, (3) requiring racket/treelist and simply referring to the treelist identifier, (4) searching for the word `type` in the racket/treelist docs.)

---

<div class="post-metadata">

**Author:** ![shawnw](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/shawnw/32/1031_2.png) [@shawnw](https://racket.discourse.group/u/shawnw)\
**Post date:** [January 11, 2025, 2:19am UTC](https://racket.discourse.group/t/using-treelists-in-typed-racket/3478/2 "2025-01-11T02:19:46Z")

</div>

Most new datatypes/functions aren't being added to Typed Racket at the same time they're introduced. Stencil vectors aren't there either, for example.

---

<div class="post-metadata">

**Author:** ![jbclements](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/jbclements/32/11_2.png) [@jbclements](https://racket.discourse.group/u/jbclements)\
**Post date:** [January 11, 2025, 10:24pm UTC](https://racket.discourse.group/t/using-treelists-in-typed-racket/3478/3 "2025-01-11T22:24:53Z")

</div>

So what you're _really_ saying is that I should ask a graduate student to get to know TR by adding this. I know just the person (_evil cackle_).

---

<div class="post-metadata">

**Author:** ![shawnw](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/shawnw/32/1031_2.png) [@shawnw](https://racket.discourse.group/u/shawnw)\
**Post date:** [January 12, 2025, 4:16am UTC](https://racket.discourse.group/t/using-treelists-in-typed-racket/3478/4 "2025-01-12T04:16:01Z")

</div>

If it was up to me, I'd just make a policy that any additions to `racket/foo` modules need to be reflected in their Typed Racket equivalent (Possibly involving creating such an equivalent) before they're accepted, or have a good reason why it can't be done given.

---

<div class="post-metadata">

**Author:** ![jbclements](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/jbclements/32/11_2.png) [@jbclements](https://racket.discourse.group/u/jbclements)\
**Post date:** [February 28, 2025, 8:10pm UTC](https://racket.discourse.group/t/using-treelists-in-typed-racket/3478/5 "2025-02-28T20:10:57Z")

</div>

This is just about done, yay! Look for a pull request on this in the next week.
