r/functionalprogramming • • Sep 21 '24

Question Ways to be a functional language

Every functional language needs two things, a functional part, and an escape hatch where it does stuff.

The functional parts are not all identical, but they are variations on the theme of "how can we express a pure expression?" It's syntax.

But then there's the escape hatch. Haskell has monads. Original Haskell defined a program as a lazy function from a stream of input to a stream of output and I would still like to know what was wrong with that. The Functional Core/Imperative Shell paradigm says you can be as impure as you like so long as you know where you stop. Lisp says "fuck it" 'cos it's not really a functional language. Etc.

Can people fill in the "etc" for me? What are the other ways to deal with state when you're functional?

20 Upvotes

17 comments sorted by