
23 Feb
2011
23 Feb
'11
8:31 a.m.
Excerpts from Xavier Shay's message of Tue Feb 22 20:25:28 -0500 2011:
On 23/02/11 10:35 AM, Edward Z. Yang wrote:
What you describe is one of the cases when a partial function is ok (though it's probably better to do something like:
giveMeThree x | x == 3 = True | otherwise = error "giveMeThree: not three"
It's frequently not possible, but if you can arrange your types so that the invalid values are not possible, even better.) ah that's good, I can give a helpful error message.
Still would like a way to test it though...
Check the section "Testing for expected errors" herE: http://leiffrenzel.de/papers/getting-started-with-hunit.html Edward