# 'where T' vs 'where {T}'

**URL:** <https://discourse.julialang.org/t/where-t-vs-where-t/55794>\
**Category:** New to Julia\
**Tags:** parametric-types\
**Created:** [February 22, 2021, 6:52pm UTC](https://discourse.julialang.org/t/where-t-vs-where-t/55794 "2021-02-22T18:52:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![danvenn](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@danvenn](https://discourse.julialang.org/u/danvenn)\
**Post date:** [February 22, 2021, 6:52pm UTC](https://discourse.julialang.org/t/where-t-vs-where-t/55794/1 "2021-02-22T18:52:07Z")

</div>

Hi, I’m really liking Julia so far, but the documentation on the usage of where has me confused (despite finding a few posts here discussing it).

What would be the difference between:

same\_type(x::T, y::T) where {T} = true  
and  
same\_type(x::T, y::T) where T = true?

Thanks

---

<div class="post-metadata">

**Author:** ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Post date:** [February 22, 2021, 7:21pm UTC](https://discourse.julialang.org/t/where-t-vs-where-t/55794/2 "2021-02-22T19:21:57Z")

</div>

There is no difference. You need the {} when you have multiple types i.e:

```julia
same_type(x::S, y::T) where {S, T} = true

```

Without the {} you get a parsing error:

```julia
julia> same_type(x::S, y::T) where S, T = true
ERROR: UndefVarError: T not defined
Stacktrace:
 [1] top-level scope at none:1

```

So really `where T` is just a convenience to save some keystrokes if there is only 1 type.

---

<div class="post-metadata">

**Author:** ![danvenn](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@danvenn](https://discourse.julialang.org/u/danvenn)\
**Post date:** [February 22, 2021, 7:42pm UTC](https://discourse.julialang.org/t/where-t-vs-where-t/55794/3 "2021-02-22T19:42:46Z")

</div>

Thanks pixel!

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [February 22, 2021, 7:46pm UTC](https://discourse.julialang.org/t/where-t-vs-where-t/55794/4 "2021-02-22T19:46:48Z")

</div>

The curlies also make the single-clause version easier for _my brain_ to parse. So it’s optional, but I find it useful for not accidentally misreading the `where T = ...` as having the _function body_ defining what `T` is!
