# Stripping parameter from parametric types

**URL:** <https://discourse.julialang.org/t/stripping-parameter-from-parametric-types/8293>\
**Category:** New to Julia\
**Tags:** parametric-types\
**Created:** [January 11, 2018, 3:03pm UTC](https://discourse.julialang.org/t/stripping-parameter-from-parametric-types/8293 "2018-01-11T15:03:46Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![jameson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jameson/32/23_2.png) [@jameson](https://discourse.julialang.org/u/jameson)\
**Post date:** [January 19, 2018, 8:18pm UTC](https://discourse.julialang.org/t/stripping-parameter-from-parametric-types/8293/10 "2018-01-19T20:18:51Z")

</div>

> [@braydenware](#):
>
> Right. That is my current solution - to define a new method or each array type that I need. I was wondering whether I could avoid that by mucking around in the type system.

No, you can’t. The approved solution is wrong – there’s no relation between the ordering of type parameters of a subtype (in this case, SomeArrayType) and its supertype (AbstractArray). `Tamas_Papp`’s solution is correct. In generic code, this is usually done by calling the `similar` function.

However, we can also generalize that solution to abstract types as follows (by adding in `<:` so that it can select subtypes):

```julia
stripN(::Type{<:AbstractArray{T, N}}) where {T, N} = AbstractArray{T, M} where M

```

---

_[View the full topic](https://discourse.julialang.org/t/stripping-parameter-from-parametric-types/8293)._
