[Haskell-cafe] reimplementing break (incorrectly) "quickcheck p list" gives me feedback that it breaks on list, but not what predicate test caused the breakage

Thomas Hartman thomas.hartman at db.com
Thu Jul 5 19:37:04 EDT 2007


I am a total quickcheck noob. Is there a way to find out what predicate 
test "<function>" is, below?

Also, is there a way I can ask quickcheck to test lists of various built 
in types, not just Int?

***********

Falsifiable, after 4 tests:
<function>
[1]
*Recursion> testMyBreak
Falsifiable, after 1 tests:
<function>
[-1,1,2]
*Recursion>


testMyBreak    = quickCheck $ \p l -> myBreak p (l :: [Int]) == break p l
myBreak t xs =
    let f t next rest =
              if t next 
                then ([], snd rest)
                else (next : fst rest, snd rest)
      in foldr ( f t ) ([],[]) xs

---

This e-mail may contain confidential and/or privileged information. If you 
are not the intended recipient (or have received this e-mail in error) 
please notify the sender immediately and destroy this e-mail. Any 
unauthorized copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20070705/4d53cdbb/attachment.htm


More information about the Haskell-Cafe mailing list