News for hackers. Stuff that matters.
Re:Learn Functional Programming Visually by random314 on Sunday February 14, 2021 @02:50PM (#26135596)
All of the real world examples you described above involve I/O. There are various approaches for this, the most popular being the IO monad.

A function using the IO Monad looks like regular imperative code except for the type signature of the function which indicates that the function side effects and thus can only be called by other functions that side effect. Pure functions cannot call a side effecting function. This helps in isolating side effects and capturing it in the type signature of functions.

Plenty of examples here

https://www.haskell.org/tutorial/io.html

Functional programming is not stateless programming. Rather it captures any state changes in the type signature. An explicit example of it would be the state monad.

Re:Learn Functional Programming Visually by millstone on Sunday February 14, 2021 @05:09PM (#26136735)
Many functional languages do not model effects in the type system, like the ML family. Many do not have static types at all, like Clojure/LISP.
Re:Learn Functional Programming Visually by random314 on Sunday February 14, 2021 @08:46PM (#26138146)
Those languages wouldn't be considered pure/stateless as intended by the OP.
Re:Learn Functional Programming Visually by roguas on Tuesday February 16, 2021 @09:44AM (#26154252)
Haskell would not be considered pure or stateless as well. What the OP is saying there are several qualities which indicate you are dealing with functional language and they are not super rigid. Typically first-class functions indicate that its possible to do things functionally. Immutable defaults takes it further. Higher kinded types usually indicate you can easily separate pure from effectful. Dependant types hint that you can have value level expectations etc.

At which point you are happy with "functional" is up to you. Its not all or none.