|
|
|
|
|
by tome
193 days ago
|
|
Ah! My favourite Haskell discussion. So, consider these two programs, the first in Haskell: main :: IO ()
main = do
foo
foo
foo :: IO ()
foo = putStrLn "Hello"
and the second in Python: def main():
foo()
foo()
def foo():
print("Hello")
For the Python one I'd say "I/O is done inside `foo` before returning". Would you? If not, why not? And if so, what purpose does it serve to not say the same for the Haskell? |
|