AllSameBy
Examples
open all close allProperties & Relations (1)
AllSameBy can be implemented by applying f to all elements and then checking whether the results are all the same:
The difference becomes apparent when there are side effects.
AllSameBy will cease evaluation if any variation in f[en] is found:
Whereas Map would evaluate on all elements prior to checking SameQ:
History
Text
Wolfram Research (2024), AllSameBy, Wolfram Language function, https://reference.wolfram.com/language/ref/AllSameBy.html.
CMS
Wolfram Language. 2024. "AllSameBy." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/AllSameBy.html.
APA
Wolfram Language. (2024). AllSameBy. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AllSameBy.html
BibTeX
@misc{reference.wolfram_2025_allsameby, author="Wolfram Research", title="{AllSameBy}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/AllSameBy.html}", note=[Accessed: 13-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_allsameby, organization={Wolfram Research}, title={AllSameBy}, year={2024}, url={https://reference.wolfram.com/language/ref/AllSameBy.html}, note=[Accessed: 13-August-2025]}