Input Processing Loops in Haskell