Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 24 05:03
    scala-steward opened #245
  • Jan 23 21:54

    alexarchambault on master

    Update sbt-scalajs, scalajs-com… (compare)

  • Jan 23 21:54
    alexarchambault closed #244
  • Jan 23 19:05
    scala-steward opened #244
  • Jan 23 18:27

    alexarchambault on master

    Update auxlib, javalib, nativel… (compare)

  • Jan 23 18:27
    alexarchambault closed #243
  • Jan 23 18:27

    alexarchambault on master

    Update sbt-ci-release to 1.5.10… (compare)

  • Jan 23 18:27
    alexarchambault closed #232
  • Jan 23 18:26

    alexarchambault on master

    Update sbt-scalajs, scalajs-com… (compare)

  • Jan 23 18:26
    alexarchambault closed #231
  • Jan 22 15:04
    scala-steward opened #243
  • Jan 20 17:19
    scala-steward synchronize #231
  • Jan 20 17:19
    scala-steward synchronize #232
  • Jan 20 13:51

    alexarchambault on master

    Update auxlib, javalib, nativel… (compare)

  • Jan 20 13:51
    alexarchambault closed #235
  • Jan 20 13:49

    alexarchambault on master

    Update sbt-mima-plugin to 1.0.1… (compare)

  • Jan 20 13:49
    alexarchambault closed #230
  • Jan 13 05:10
    scala-steward closed #234
  • Jan 13 05:10
    scala-steward commented #234
  • Jan 13 05:10
    scala-steward opened #242
Alexandre Archambault
@alexarchambault
I'll check sooner if can
Miles Sabin
@milessabin
I don't think there were any changes RC4-RC6 which would account for that change.
@adelnizamutdinov do you have a small standalone reproduction?
Adel Nizamutdinov
@meoyawn
let me quickly upload one @milessabin
Adel Nizamutdinov
@meoyawn
Adel Nizamutdinov
@meoyawn
alexarchambault/scalacheck-shapeless#7
Adel Nizamutdinov
@meoyawn
I also wanted to say that shapeless scalacheck makes scalacheck lots and lots more pleasurable than TH.deriveArbitrary for QuickCheck :)
Alexandre Archambault
@alexarchambault
all the credit goes to @milessabin :-) (for shapeless)
thanks for the issue, I'll have a look at it
Miles Sabin
@milessabin
Comments on my update on #7 would be hugely welcome.
Greg Pfeil
@sellout
So, I added scalacheck-shapeless, tried removing some Arbitrary instances, but now compilation is at least an order-of-magnitude slower. (Well, it’s actually still going, so we’ll see how that ends up.)
Greg Pfeil
@sellout
Ok, I think we can go with “nonterminating”.
Miles Sabin
@milessabin
shapeless's Lazy effectively turns off scalac's checks for implicit divergence. On the plus side that means we can build recursive instances (for recursive data types). On the minus side, that means that it is possible to make the typechecker loop if resolution doesn't actually converge.
If you can post an example (preferably reduced) of what you're trying to do we should be able to help you out.
Alexandre Archambault
@alexarchambault
@sellout The trick described here sometimes speeds up things a bit (along with allowing slow-to-compile parts of code not to be recompiled too often).
More generally, things can get quite slow with large code bases (having one at work, I didn't switch all derivations to the "canonical" way of doing of scalacheck-shapeless, that is Lazy-based)
@milessabin I ran into non terminating compilations too, only recently, when trying to replace upickle macros with shapeless. It only happened with orphan derivation on.
Alexandre Archambault
@alexarchambault
That's what made want to replace it, milessabin/shapeless#427
Noel Markham
@noelmarkham
Hi - is there a maven artifact for scalacheck-shapeless with scalacheck 1.13? I can see the commits but can't work out if there's a jar out there
Alexandre Archambault
@alexarchambault
@noelmarkham Yep, the current snapshot (1.0.0-SNAPSHOT) is built against scalacheck 1.13 and pushed to Sonatype Snapshots.
I just updated the README to reflect that.
See the end of it.
Noel Markham
@noelmarkham
brilliant, thanks for the update
Dario Abdulrehman
@dabd
Hi, I am trying to use scalacheck-shapeless to generate arbitrary case classes that are using tagged types. However scalacheck does not seem to be able to generate Arbitrary instances in this case: https://gist.github.com/dabd/fbf5336b51f4c5d3bcd1404a76498a88
Olli Helenius
@liff
might it be the same issue as travisbrown/circe#220 ?
does it work if you define an Arbitrary for String @@ Baz
Dario Abdulrehman
@dabd
@liff that is what the implicit conversion arbTagged should be doing isn't it?
Olli Helenius
@liff
yes, but it might be a bit too generic
Dario Abdulrehman
@dabd
I gave it a go with implicit val arbTaggedString: Arbitrary[String @@ Baz] = Arbitrary(tag[Baz](Arbitrary.arbString)) but it doesn't compile. Is this how you define an Arbitrary[String @@ Baz]?
Olli Helenius
@liff
just replace the type parameters with concrete types in your original:
implicit val arbTaggedString: Arbitrary[String @@ Baz] = Arbitrary(arbitrary[String].map(a => tag[Baz](a)))
Dario Abdulrehman
@dabd
yeah it works, thanks. It seems like I need to define these explicitly then. I wonder why the implicit def is not working then
Olli Helenius
@liff
indeed
wonder if it's some compiler bug related to type aliases or something
seems to work with a generic tag:
implicit def arbTaggedString[T]: Arbitrary[String @@ T] = Arbitrary(arbitrary[String].map(a => tag[T](a)))
but not for generic on the left (i.e. T @@ Baz)
Dario Abdulrehman
@dabd
yes it works. I'd like to understand why
Simon Hafner
@reactormonk
How do I pass in Arbitrary instances for .e.g. String? implicit val stringArb: Arbitrary[String] = Arbitrary.arbitrary[String] suchThat (_ != "") gives me a Gen[String].
implicit val stringArb: Arbitrary[String] = Arbitrary(Arbitrary.arbitrary[String] suchThat (_ != "")) looks like it works
Miguel Iglesias
@caente

I’m “generating” Arbitrarys instances for several data structures that are basically sealed traits hierarchies that include cases classes, which have parameters that are sealed traits hierarchies as well — different ones

The compile times are horrendous. The PoC was with all the Arbitrary instances declared in the same file, and the dependencies among them were handled “globally”… until that stopped working, i.e. it never finishes compiling.

I’m trying to make it the most modular as possible, any recomendation? (I’m hopping for hidden tricks and caveats)

Miguel Iglesias
@caente

I’d like to be only able to create an instance of Arbitrary of a sealed trait hierarchy, if all the parameters if the children have explicit-implicit Arbitrarys, e.g.

case class TimeConstraint( t:LocalTime, m:Modifier, a:Activity )

implicit def timeConstraintArb(
    implicit
    lt: Arbitrary[LocalTime],
    m:  Arbitrary[Modifier],
    a:  Arbitrary[Activity]
  ):Arbitrary[TimeConstraint]

where Modifer and Activity are also sealed traits
the goal is that this method does not compile if the instances are not present…
for example, this version with out Arbitrary[Activity]

implicit def timeConstraintArb(
    implicit
    lt: Arbitrary[LocalTime],
    m:  Arbitrary[Modifier]
  ):Arbitrary[TimeConstraint]

should not compile.

But if I just add import org.scalacheck.Shapeless._in the method body, then it will “just work”, which is undesirable here...

id there a way to achieve this?
I’ve been looking at the source, but it hasn’t being obvious...
Miguel Iglesias
@caente
the main goal of all this is still to find out why the compiler hangs forever
Miguel Iglesias
@caente
and to have more control over what Arbitrarys are being used
Gabriel Assis Bezerra
@gabriel-bezerra
Hi. After I have imported org.scalacheck.Shapeless._, my v match { case O1 => f(O1) } are failing with "possible missing interpolator: detected an interpolated expression"
I have no $ over there
have you ever seen such thing
btw, def f[A](v: V[_, A])(implicit a: Arbitrary[A]): Arbitrary[A] = a
I'm not using strings or any "s around