On 30 Jan 2008, at 7:19 PM, Anton van Straaten wrote:

Derek Elkins wrote:
On Thu, 2008-01-31 at 02:18 +0000, Neil Mitchell wrote:
...
It isn't something that would throw a C programmer off, but it is
something that could confuse a pure Haskell programmer. And the only
way I could be sure of radians versus degrees was by trying it out,
not a great strategy for determining the implementation of functions!
Uh, why not?  Often that's exactly what I do as checking even
conveniently located documentation is more time consuming than just
trying it.

I agree, but at the risk of veering uncharacteristically off-topic for haskell-cafe, I think it's an interesting example of the degree of assurance about correctness we're willing to accept in practice, in real development.

We discover a function called, say, "cos", probably by guessing it's name, run a very small number of simple tests on it, see the answers we expect, and decide that it's the function we want.

True enough; more complicated tests seem to reveal the opposite conclusion:

> quickCheck $ \ x -> cos (x + 2*pi) == cos x
Falsifiable, after 2 tests:
-1.0

jcc

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to