by johnpattiyson · 14y ago · 0 comments
This is one of several ways that Haskell worked before there was an IO monad [1], all allowing pure functional useful programmes.
[1] S. Peyton Jones. Tackling the awkward squad: monadic input/output, concurrency, exceptions, and foreign-language calls in haskell. Technical report, Microsoft Research, Cambridge, 2010.
My purely functional programs actually do things! Amazing that my ivory tower allows me to say "Hello World".
For non-interactive use (like a compiler) you could implement the program as a function taking and returning a string.