<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jun 8, 2014 at 1:56 AM, Rafael Almeida <span dir="ltr"><<a href="mailto:almeidaraf@gmail.com" target="_blank">almeidaraf@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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?</blockquote>

</div><br></div><div class="gmail_extra">The problem is that (!!) is a partial function, like head. How would you check that head [] is an error?<br><br></div><div class="gmail_extra">What you could do is quickcheck a safe version of (!!) -- see Safe.atMay -- that returns a Maybefied type.<br>

</div><div class="gmail_extra"><br clear="all"><div>-- Kim-Ee</div>
</div></div>