interactfirst reads all the input, then prints the result of the transfer of the entire input to the function. And if the working function does not require only the initial part of the input, the Haskell runtime should be read until the end of the input. Your function consumes the entire string, so this is happening.
Therefore, you will not get the result until you finish typing (i.e. CTRL + D on Unix).
source
share