pixel:
> Chris Moline <[EMAIL PROTECTED]> writes:
> 
> > dropWhile p = foldr (\x l' -> if p x then l' else x:l') []
> 
> invalid:  dropWhile (< 5) [1, 10, 1]  should return [10, 1]

Prelude Test.QuickCheck Text.Show.Functions> quickCheck $ \p xs -> dropWhile p 
xs == foldr (\x l' -> if p x then l' else x:l') [] (xs :: [Int])

Falsifiable, after 4 tests:
<function>
[-1,-3,1]


If in doubt, do a quick check!

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

Reply via email to