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 Apr 9

If I don't use React, am I still a developer?

A self-taught developer, more confident in his abilities than ever, feels he's just a hack because he doesn't understand anything anymore

Michael Lee 🍕 profile image
Maker of things, giver of high-fives 🖐

Read more long-form software content.

Sign up (for free)

Become a better software developer.