[Haskell-beginners] Re: Code help requested
Joe Van Dyk
joe at fixieconsulting.com
Fri Jan 15 20:48:32 EST 2010
On Fri, Jan 15, 2010 at 5:17 PM, Tim Perry <perry2of5 at yahoo.com> wrote:
> Hi Joe,
> I think you wanted (length list - 1) where you call do_search. The version below is my rewrite with guards, this change, and "midVal" which keeps "list !! mid" from being evaluated twice per recursion. Unfortunately, I have no idea how to work a fold into this. Good luck!
Ah, I was trying to figure out how to use guards here, but I couldn't
figure out the syntax. Thanks for the help!
What's the best way to unit test this function? Quick-check? What
would that look like?
More information about the Beginners