4 ms·
> In functional programming EVERY function is a single expression, including the main itself. In fact, in functional programming, your Entire program is just a
by zenhack 9y ago
> In functional programming EVERY function is a single expression, including the main itself. In fact, in functional programming, your Entire program is just a single expression.
This is a technicality. There's basically always a mechanism for chaining two expressions and junking the result of the first. In OCaml, the semicolon operator does this. In Scheme (and most lisps) you can just put multiple expressions in the body of the function, and the return value will be the last one. And there's `begin` if you want a block that's not a function. In Haskell, the purity makes this actually not make sense in most contexts, but you've got `(>>)` for monads, and the do-notation which sugars it into something that looks basically like a statement.
Some version of that in python would be an acceptable alternative.
But there's also stuff like moving reduce to a separate package.