
7 Jun
2014
7 Jun
'14
3:40 p.m.
On Sun, Jun 8, 2014 at 1:56 AM, Rafael Almeida
Let's say we want to quickcheck the function !!. Passing a negative index to it is an error. However, how can you make a check that it indeed errors in such situation?
The problem is that (!!) is a partial function, like head. How would you check that head [] is an error? What you could do is quickcheck a safe version of (!!) -- see Safe.atMay -- that returns a Maybefied type. -- Kim-Ee