modify haskell binary search