main loop to Haskell