# How to find to which module a type belongs to?

**URL:** <https://discourse.julialang.org/t/how-to-find-to-which-module-a-type-belongs-to/7911>\
**Category:** General Usage\
**Created:** [December 22, 2017, 5:27am UTC](https://discourse.julialang.org/t/how-to-find-to-which-module-a-type-belongs-to/7911 "2017-12-22T05:27:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qiyamah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qiyamah/32/2660_2.png) [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Post date:** [December 22, 2017, 5:27am UTC](https://discourse.julialang.org/t/how-to-find-to-which-module-a-type-belongs-to/7911/1 "2017-12-22T05:27:04Z")

</div>

Hi fellows,

Let’s assume, I have a type XYZ which i currently use in my current module , however XYZ is defined in some other module. How can i get to which module XYZ belongs to?

Thanks

---

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [December 22, 2017, 9:00am UTC](https://discourse.julialang.org/t/how-to-find-to-which-module-a-type-belongs-to/7911/2 "2017-12-22T09:00:13Z")

</div>

```julia
julia> get_module(name) = eval(parse(string(name)[1:findlast(string(name), '.')-1]))
get_module (generic function with 1 method)

julia> using StaticArrays

julia> get_module(SArray)
StaticArrays

```

Edit: see below for proper way!

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [December 22, 2017, 9:44am UTC](https://discourse.julialang.org/t/how-to-find-to-which-module-a-type-belongs-to/7911/3 "2017-12-22T09:44:48Z")

</div>

```julia
julia> using StaticArrays

julia> @which SArray
StaticArrays

```
