On 2/14/12 8:30 AM, Andrew Pennebaker wrote:
Again, the type system is the problem: it's clearly wonderful and
declarative, like Haskell and Erlang, where QuickCheck originates, but
I'm not sure how to properly wield Rust's type system to port over
QuickCheck's for_all function.
I just posted this on stackoverflow in response to your query there, but
would this work for you:
| fn for_all<A>(test: fn(A) -> bool, generators: [fn() -> A]) -> bool {
vec::all(generators) {|gen| test(gen()) }
}|
Niko
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev