What is the "<>" operator called in Elixir?

twitter logo github logo ・1 min read

I'm reading over the Elixir guides and recently came across the various operators. One of which is the <> operator used to concatenate two stings. It doesn't mention a name for the operator though. And it's my first time seeing that in any language.

"Hello" <> " World"
"Hello World"
twitter logo DISCUSS (6)
markdown guide

I'd call <> the "concatenation operator" or "string concatenation operator", which is what the Elixir documentation refers to it as.

If speaking causally, I might call it "cat", "concat", or "join".


Makes sense. The docs seems to use symbols to describe how to do something versus the need to name everything. Looking over the doc I noticed other things such as ++ to combine lists. I suppose you could infer that it's called plus plus but really the symbol is used to describe what it does.


In my head I just call it the "string concatenation operator", I've also never seen any official name for it. I don't believe it's used for anything else.


Yeah, I figured it's more of a symbol to represent a function or utility to do something. Just wasn't sure if it had a name. Looking over the doc I realized there's a lot of other symbols used to do things but don't actually have names such as ++ use to combine lists.

Think I'll probably be calling it that in my head as well :)


In Haskell, this would be called "mappend", for Monoid append.

(Actually it's Semigroup append, but don't let that bother you)

Classic DEV Post from Jan 28

Do you have any energy and time for your personal goals after a full day of work at your job?

Michael Lee πŸ• profile image
Maker of things, giver of high-fives πŸ–

By the community, for the community.

DEV is open source, committed to the open web, and quickly becoming the biggest world's biggest network of software developers.

Get started now ❀️