Haskell programmer in an infinite loop