I miss the ternary operator - does anyone have a macro that allows a ternary operator in Elixir code?

How do we NOT do this all the time? If I can get a good deal, I’ll buy the fancier thing, else I’ll buy the regular one. If I finish mowing the lawn in time, I’ll spend some time playing with the dog before my next commitment. If I have some steak in the freezer, then I’ll have steak for dinner, else chicken.

I can’t see how your position can be interpreted to make it make sense? How is life not completely full of an either-or decisions based on conditions?

That’s a statement, not a question.

“It is tempting, if the only tool you have is a hammer, to treat everything as if it were a nail.”

That’s two consecutive function calls, a monad.

That’s a queue of actions operated by a timer click.

That’s a monad, too.

An if statement could be written as a monad, but it does not have to be…