Question Details

No question body available.

Tags

haskell functional-programming monads applicative io-monad

Answers (1)

Accepted Answer Available
Accepted Answer
October 5, 2025 Score: 3 Rep: 156,135 Quality: High Completeness: 50%

Statically, in this case, does not mean at compile time. Rather it's a phase distinction within the run-time of your program -- specifically before and after you execute the actions of your mote.

But yet, it's not like I know at compile time anything more than the length of the resulting list as function of the runtime length of the other two lists.

Right. But at runtime, you can know the length of the output without even computing the values contained in the input lists, let alone the value of the output list.

the compiler could look at either code and work out that there's no other IO actions around than getLine and putStrLn

True. But in the version, you know that both effects will always happen, whereas in the >>= version the putStrLn effect may or may not happen.