# How to skip type parameters in function signature

**URL:** <https://discourse.julialang.org/t/how-to-skip-type-parameters-in-function-signature/106300>\
**Category:** General Usage\
**Created:** [November 16, 2023, 7:05am UTC](https://discourse.julialang.org/t/how-to-skip-type-parameters-in-function-signature/106300 "2023-11-16T07:05:47Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)\
**Post date:** [November 16, 2023, 7:27am UTC](https://discourse.julialang.org/t/how-to-skip-type-parameters-in-function-signature/106300/2 "2023-11-16T07:27:45Z")

</div>

> [@heliosdrm](#):
>
> `mymethod(x::Foo{A}) where {A}`

You’re not skipping `B` there either, it’s a shorthand for a `where` clause: `::Foo{A,Bi} where Bi`. Julia didn’t used to [print shorthands of UnionAll types](https://discourse.julialang.org/t/printing-of-unionall-types-is-misleading-as-of-julia-version-1-7/89418), so it’s worth checking with `typeof` now.

> [@heliosdrm](#):
>
> Is there also a way of telling “I don’t need the first type parameter, but I do want the second”?

You can do something similar to omit the 1st parameter from the method’s where clause, but it must be made clear there is a type parameter there rather than some other type from the global scope: `mymethod(x::Foo{Ai, B} where Ai) where {B}`. `Ai` will not be available as a variable in the method body, it’s limited to the parametric type expression.

> [@heliosdrm](#):
>
> it’s an “all-underscore identifier used as rvalue” syntax error.

`_` is just a variable, not some placeholder token, and all-underscore variables are intended solely for throwaway assignments, so they can only show up on the left hand side of `=`. If you replaced it with a variable `Ai`, you’d hit an undefined variable error because `Ai` isn’t assigned in the outer scope or specified in a `where` clause.

---

_[View the full topic](https://discourse.julialang.org/t/how-to-skip-type-parameters-in-function-signature/106300)._
