# Idiomatic pattern matching without arity overloading. (Single function vs mutliple)

**URL:** <https://forum.elixirforum.com/t/idiomatic-pattern-matching-without-arity-overloading-single-function-vs-mutliple/67206>\
**Category:** Questions\
**Tags:** learning-elixir\
**Created:** [November 3, 2024, 11:58am UTC](https://forum.elixirforum.com/t/idiomatic-pattern-matching-without-arity-overloading-single-function-vs-mutliple/67206 "2024-11-03T11:58:50Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![markusgod](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/markusgod/32/28980_2.png) [@markusgod](https://forum.elixirforum.com/u/markusgod)\
**Post date:** [November 3, 2024, 12:32pm UTC](https://forum.elixirforum.com/t/idiomatic-pattern-matching-without-arity-overloading-single-function-vs-mutliple/67206/3 "2024-11-03T12:32:31Z")

</div>

I haven’t thought about having a private functions, that may work for me.  
Regarding spec. I want to specify that my function accepts a subset of what specified in a callback definition. Instead of `term()` specific terms `{:send, string.t()}` and etc.  
Maybe I can create a type that will encapsulate all allowed terms, and use it in a single spec, but that will mix up a return value types.  
Or maybe spec per function is good enough.

 ![Screenshot 2024-11-03 152928](https://forum.elixirforum.com/uploads/default/original/3X/9/1/9178f46da21aa460c481d8c93003bdb888582a5a.png)

---

_[View the full topic](https://forum.elixirforum.com/t/idiomatic-pattern-matching-without-arity-overloading-single-function-vs-mutliple/67206)._
