Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generalize props to several arguments #16

Closed
juanrh opened this issue Aug 25, 2015 · 1 comment
Closed

generalize props to several arguments #16

juanrh opened this issue Aug 25, 2015 · 1 comment

Comments

@juanrh
Copy link
Owner

juanrh commented Aug 25, 2015

A first version would just extend the forall - always prop to only 1 input 1 derived, 2 input 1 derived, 1 input 2 derived, 2 inout 2 derived.

The main difference with ScalaCheck Prop.forall, which just has hand coded props for arities from 1 to 8 by using currying, is that the combination of input and derived dstreams lead to 8 x 8 = 64 possibilities. Also it is not clear that currying could be applied here. Hence consider Shapeless HList https://github.com/milessabin/shapeless/wiki/Feature-overview:-shapeless-2.0.0
to simulate heterogeneously typed varargs, instead of relaying on several overload for different arities. But it is important that the user only needs to use raw tuples, use the typpe reconstruction capabitilies of .cast, or "facilities for abstracting over arity": we can ask the user to use a convention based on position of the argument, but the type should be preserved.

@juanrh
Copy link
Owner Author

juanrh commented Nov 30, 2015

A simpler solution is using a fixed number of arguments, which fixes the number of type variables, and using Option to express optional arguments, e.g. Option[Gen[Seq[Seq[Ei]]]]. Then we'd have a single complex version of DStreamProp.forAll, and all the other version with simpler parameters would be wrappers on particular calls to the complex one

@juanrh juanrh added this to the Sscheck 0.3 milestone May 15, 2016
juanrh added a commit that referenced this issue May 23, 2016
for #16 implementation schema completed, missing
extra overloads of forAllDStream based on generic
version, and supporting up to 4 generators and
transformation, currently only 2 for routinary work
@juanrh juanrh closed this as completed Aug 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant