|
|
|
|
|
by endgame
1453 days ago
|
|
Not as an "escape hatch" (that would be something more like `unsafePerformIO :: IO a -> a`), but as a principled way to compose (among other things) IO actions. A Haskell program executes the IO action at `Main.main`, which must have type `IO ()`. `putStrLn :: String -> IO ()` is a pure function - if you give it the same input, it always the same IO action as a result. |
|
I personally don't use functional languages because I find them too difficult given the needs and interests I have. I think about computations sequentially most of the time.