Is there a shorthand version to destructure maps/structs in function definition

Interesting, I actually didn’t know that. I found this thread talking about it. Is the performance really “abysmal” though? Don’t multi-head functions compile to case as well? I know they do in Haskell but I can’t remember with Elixir.

Agreed. There are exceptions to every rule, of course, and that is if the win is big enough. Pathex for example (well, it’s doing a bit more than adding syntax in a bunch of cases). Though whenever I use or import Pathex I do in the function I’m using it in.

Amen. I have a strict rule for myself to never use multi-lined function heads. It’s never caused any problems! Credo rule pending :slight_smile:

Hear hear. I understand if peoples’ programming style warrants it, and honestly for now I’m just happy it’s not a thing. If it does become a thing, it would be nice if it wasn’t touted as “the” way as it is in JS land. The formatter shouldn’t force it (I don’t see why it would) and hopefully Credo wouldn’t make it a default.