what are use cases for this type, maybe put some example. What are pros and cons of it
For most users, box really is never needed. It has 2 main use cases:
In general, I would just say don't worry about it. Fundamentally it just puts something on the heap with a refcount instead of on the stack. That said, i think today it is missing some optimizations and generally should be ignored.
I've added some documentation for Box https://github.com/roc-lang/roc/pull/5553
Last updated: Jul 05 2025 at 12:14 UTC