Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 14 22:08
    scala-steward closed #218
  • Sep 14 22:08
    scala-steward commented #218
  • Sep 14 22:08
    scala-steward opened #227
  • Aug 03 22:05
    scala-steward opened #226
  • Aug 02 12:07

    dependabot[bot] on github_actions

    (compare)

  • Aug 02 12:07
    dependabot[bot] closed #224
  • Aug 02 12:07
    dependabot[bot] commented #224
  • Aug 02 12:07
    dependabot[bot] labeled #225
  • Aug 02 12:07
    dependabot[bot] opened #225
  • Aug 02 12:07

    dependabot[bot] on github_actions

    Bump coursier/cache-action from… (compare)

  • Jul 12 12:05
    dependabot[bot] labeled #224
  • Jul 12 12:05
    dependabot[bot] opened #224
  • Jul 12 12:05

    dependabot[bot] on github_actions

    Bump coursier/cache-action from… (compare)

  • Jul 12 07:36
    scala-steward closed #221
  • Jul 12 07:36
    scala-steward commented #221
  • Jul 12 07:36
    scala-steward opened #223
  • Jul 03 04:06
    scala-steward opened #222
  • Jun 14 04:07
    scala-steward closed #219
  • Jun 14 04:07
    scala-steward commented #219
  • Jun 14 04:07
    scala-steward opened #221
Nicolas Rinaudo
@nrinaudo
I'd be happy to provide more information or further tests if needed, and would appreciate any help I can get with this matter :)
Nicolas Rinaudo
@nrinaudo
alright, so this does not appear to be a scalacheck-shapeless problem explicitly. I've re-implemented a simple automatic derivation mechanim and run in exactly the same issues, and this didn't use to happen when using scalacheck 1.12.5. Possibly a scalacheck regression?
Nicolas Rinaudo
@nrinaudo
@alexarchambault in #50, when you talk about recursive types, does that include Or in the following example?
sealed trait Or[+A, +B] extends Product with Serializable
case class Left[A](a: A) extends Or[A, Nothing]
case class Right[B](b: B) extends Or[Nothing, B]
I would have thought not, but #51 does not seem to fix this use case as expected. Is it because the intermediate shapeless representation is recursive?
Alexandre Archambault
@alexarchambault
@nrinaudo alexarchambault/scalacheck-shapeless#51 should have fixed that... It even tests it.
Or shouldn't be considered recursive here, yeah. Recursive is meant for trees for example (where a constructor / case class references the base trait).
Nicolas Rinaudo
@nrinaudo
@alexarchambault probably my fault then, I thought I was on #51's latest commit but I might not be
I wanted to say I really appreciate how helpful you're being with this, by the way.
Zacharias J. Beckman
@zbeckman
I have a very general question (more oriented toward scalacheck than shapeless) – are there tools for generating complex properties that demonstrate a single negative trait? For instance, let's say you have a really, really large (deeply nested) data type. You want to generate a lot of positive properties but also negative ones -- but I don't want to have every attribute fail validation. I'd rather general hundreds of properties, each one with a single attribute 'wrong'.
So far I've been able to compose properties that have an essentially randomized number of 'wrong' attributes -- but there's always the chance that 1) there will be more than one attribute that's wrong, and 2) that eventually I'll generate a property that (randomly) happens to have zero negative attributes... so it won't fail.
ykycxzsv
@ykycxzsv
i have a recursive ADT, and when i implicitly derive a Cogen for it, i get a StackOverflowError at runtime. is there a trick to avoid that?
ykycxzsv
@ykycxzsv
is this project still active, or are there better alternatives for generating scalacheck types? no comment on the Cogen issue for months either here or in the issue tracker...
Georgi Krastev
@joroKr21
It works just fine for me and recently got my PR merged quite fast, so I would say it's active.
I commented on your issue, although I can't say whether the original intention was to support recursive types for Cogen or not.
ykycxzsv
@ykycxzsv
it's been a while since i looked at scalacheck, but i think both Cogen and Arbitrary instances are needed for types to be generated? as noted in the issue, Arbitrary works with recursive types. possibly Cogen is more recent
Georgi Krastev
@joroKr21
Cogen is the dual of Gen (look at the signature of perturb - it combines the current seed with a value of some type to produce the next seed). This is useful for generating arbitrary functions in order perturb the seed for the result with the argument. So if you wanted Arbitrary[Tree => A] you would indeed need Cogen[Tree]. I don't see any theoretical limitation so it might just be a missing implementation.
Felipe Hummel
@felipehummel
Someone has any idea/pointers on how to solve this issue? alexarchambault/scalacheck-shapeless#55
It's a bit annoying to turn off the shrinking
wedens
@wedens
can I use scalacheck-shapeless to generate instance non-recursively? e.g. if I have case class X(y:Y, z: Z) I want it to generate Arbitrary[X] and use existing Arbitrary[Y] and Arbitrary[Z]
Daniela Sfregola
@DanielaSfregola
@wedens yes, you should be able to do that with no problem
make sure to have Arbitrary[Y] and Arbitrary[Z] implcitly in your scope....and it should just work
Addison Higham
@addisonj
looking for a bit of guidance, have some case classes that are tied together through some shared ids (they represent a data model), for example say I want to generate some data for case class Foo(accountId: Long, name: String) and case class Bar(accountId: Long, name: String) such that accountId is either equal or not for all instances of Foo or Bar. Is there a way to do that? Obviously I could just write a generator and choose accountId and create new instance manually, but some of these case classes have a lot parameters
Olli Helenius
@liff
is it possible/useful to explicitly materialize Arbitrary instances? this doesn't work for some reason
i'm hoping, by using explicit instances, it'd compile a bit faster maybe?
wedens
@wedens
org.scalacheck.derive.MkArbitrary[A].arbitrary
Olli Helenius
@liff
oh ok, thanks a lot
Cause Chung
@cuzfrog
@alexarchambault Is there any way to provide a non-empty arbString to substitute the string scalacheck-shapeless uses to gen class?
Simon Hafner
@reactormonk
@cuzfrog regular implicit replacement.
Cause Chung
@cuzfrog
@reactormonk thanks
Albert Serrallé Ríos
@aserrallerios
Hi all!
just a simple question
case class B(i:Int)
case class A(b:B)
implicit val _ = Arbitrary(implicitly[Arbitrary[B]].arbitrary.filter(_ == 0)))
val a = implicitly[Arbitrary[A]]
should a only generate B(0) instances?
Albert Serrallé Ríos
@aserrallerios
sorry guys, it's working
my problem was that I was not providing implicit instances of Arbitrary, but implicit instances of Gen :thumbsup:
Howy Perrin
@howyp
@alexarchambault Thanks for merging #77 , any idea when the next release might be?
Alexandre Archambault
@alexarchambault
@howyp I'll do a release after these few more updates: alexarchambault/scalacheck-shapeless#78.
Howy Perrin
@howyp
Great, thanks
Alexandre Archambault
@alexarchambault
Doing a release slipped my mind, will try to do it today if I can get my gpg keys from where I am right now…
Alexandre Archambault
@alexarchambault
@howyp 1.1.8 is out!
Howy Perrin
@howyp
🎉
Thanks!
Luciano
@lJoublanc
Morning. Does scalacheck-shapeless provide any sort of automatic coproduct generation? E.g. if I have a sealed trait, can I just do Arbitrary[MyTrait] and have it return it's subclasses?
Olli Helenius
@liff
@lJoublanc like this?
Luciano
@lJoublanc
exactly!
Would this work with Arbitrary[A :+: B :+: C] too, do you know?
I'll try it out.
Luciano
@lJoublanc
yeah that doesn't work :( trying to do Arbitrary[Int :+: Long]. On the other hand Arbitrary[AnyVal] does work, but I get lots of stuff I don't want (Unit) for example.
Georgi Krastev
@joroKr21
There is definitely an Arbitrary for Coproducts somewhere in there, maybe it's just not exposed. Look around the source code.
found it - MkCoproductArbitrary
Luciano
@lJoublanc
Thanks @joroKr21 will check it out today.