Copy readMaybe/readEither from base for backwards compatibility