binary search

a monadic version of binary search.