pi search function in Haskell