# Dispatch on specific Unitful unit

**URL:** https://discourse.julialang.org/t/dispatch-on-specific-unitful-unit/124774
**Category:** General Usage
**Tags:** unitful
**Created:** [January 14, 2025, 7:45pm UTC](https://discourse.julialang.org/t/dispatch-on-specific-unitful-unit/124774 "2025-01-14T19:45:54Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![Nathan\_Boyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nathan_boyer/32/14825_2.png) [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)
#### Post date: [July 11, 2025, 1:32pm UTC](https://discourse.julialang.org/t/dispatch-on-specific-unitful-unit/124774/8 "2025-07-11T13:32:11Z")

</div>

Saving this here for myself:

> [@Julia's type system : what am I missing?](https://discourse.julialang.org/t/julias-type-system-what-am-i-missing/130618/12):
>
> Adding to @Daniel_Berge 's answer, you can easily dispatch on more specific aliases: const Len{T} = Quantity{T,u"𝐋"} const Met{T} = Quantity{T,u"𝐋",typeof(m)} const Deg{T} = Quantity{T,NoDims,typeof(°)} const Rad{T} = Quantity{T,NoDims,typeof(rad)} You don’t need to construct concrete Unitful.jl types for dispatch. And you can let Julia figure out the exact type in a field using a type parameter: struct Foo{L\<:Met} len::L end

---

_[View the full topic](https://discourse.julialang.org/t/dispatch-on-specific-unitful-unit/124774)._
