Is there a way to "print" a string in terminal and the user can edit this string and press Enter to confirm and pass it back into program?
Yes, using haskeline
(a readline-style library). It has the function getInputLineWithInitial
which has the behavior you are asking for. Example:
import System.Console.Haskeline
main = do
result <- runInputT defaultSettings $ getInputLineWithInitial ""
("Pass string to edit in terminal ", "in Haskell program")
print result