# What is the meaning of "|" in the type spec of list?

**URL:** <https://erlangforums.com/t/what-is-the-meaning-of-in-the-type-spec-of-list/2998>\
**Category:** Questions / Help\
**Tags:** erlang, typespec\
**Created:** [November 2, 2023, 12:23pm UTC](https://erlangforums.com/t/what-is-the-meaning-of-in-the-type-spec-of-list/2998 "2023-11-02T12:23:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ljzn](https://erlangforums.com/user_avatar/erlangforums.com/ljzn/32/2141_2.png) [@Ljzn](https://erlangforums.com/u/Ljzn)\
**Post date:** [November 2, 2023, 12:23pm UTC](https://erlangforums.com/t/what-is-the-meaning-of-in-the-type-spec-of-list/2998/1 "2023-11-02T12:23:09Z")

</div>

Hello, I’m using the :crypto lib of Erlang, and searching the document, there is a type spec of [`:crypto.verify`](https://www.erlang.org/doc/man/crypto#verify-6).

And the type of arg `Key` is

```erlang
Key = 
    rsa_public() |
    dss_public() |
    [ecdsa_public() | ecdsa_params()] |
    [eddsa_public() | eddsa_params()] |
    engine_key_ref()

```

My question why there is a `|` instead of `,` in type ` [ecdsa_public() | ecdsa_params()]`?

An example value of that is `[secp256r1, <<1, 2, 3,...>>]`. So I think type `[ecdsa\_public(), ecdsa\_params()]

---

<div class="post-metadata">

**Author:** ![jhogberg](https://erlangforums.com/user_avatar/erlangforums.com/jhogberg/32/179_2.png) [@jhogberg](https://erlangforums.com/u/jhogberg)\
**Post date:** [November 2, 2023, 12:26pm UTC](https://erlangforums.com/t/what-is-the-meaning-of-in-the-type-spec-of-list/2998/2 "2023-11-02T12:26:00Z")

</div>

In type specs, `|` is the union operator. `[a | b | c]`describes a list that may contain elements that are either `a`, `b`, or `c`.

---

<div class="post-metadata">

**Author:** ![Ljzn](https://erlangforums.com/user_avatar/erlangforums.com/ljzn/32/2141_2.png) [@Ljzn](https://erlangforums.com/u/Ljzn)\
**Post date:** [November 2, 2023, 5:11pm UTC](https://erlangforums.com/t/what-is-the-meaning-of-in-the-type-spec-of-list/2998/3 "2023-11-02T17:11:47Z")

</div>

It’s make sense, thank you!
