Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 20 12:24

    alexarchambault on main

    Update scala-library to 2.12.17… (compare)

  • Sep 20 12:24
    alexarchambault closed #314
  • Sep 20 12:24
    alexarchambault synchronize #313
  • Sep 20 12:20

    alexarchambault on main

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

  • Sep 20 12:20
    alexarchambault closed #312
  • Sep 19 12:30
    scala-steward opened #314
  • Sep 19 12:30
    scala-steward opened #313
  • Sep 19 12:30
    scala-steward opened #312
  • Sep 14 08:28
    alexarchambault closed #311
  • Sep 14 08:28

    alexarchambault on main

    Update shapeless to 2.3.10 (#31… (compare)

  • Sep 13 12:12
    scala-steward opened #311
  • Sep 13 09:23
    alexarchambault closed #310
  • Sep 13 09:23

    alexarchambault on main

    Update utest to 0.8.1 (#310) (compare)

  • Sep 09 12:20
    scala-steward opened #310
  • Sep 05 08:28

    alexarchambault on main

    Update refined to 0.10.1 (#307) (compare)

  • Sep 05 08:28
    alexarchambault closed #307
  • Sep 05 08:28

    alexarchambault on main

    Update nscplugin, sbt-scala-nat… (compare)

  • Sep 05 08:28
    alexarchambault closed #309
  • Sep 03 12:04
    scala-steward opened #309
  • Aug 15 16:19

    alexarchambault on github_actions

    (compare)

Miles Sabin
@milessabin
Lazy doesn't derive anything ... it just suppresses divergence.
Alexandre Archambault
@alexarchambault
Yes, I mean: implicits found with implicitly are fine (checked with reify), trying to get the same implicits with Lazy.mkLazy fails
The error says that the macro expansion tries to use types that are private[argonaut], sub-types of argonaut.Json
But these shouldn't be involved. They are not when using just implicitly, as reify confirms.
Miles Sabin
@milessabin
Hmm ... interesting.
Alexandre Archambault
@alexarchambault
This notebook illustrates that, if this is fine for you. I'll try to minimize this.
Miles Sabin
@milessabin
Using Lazy very likely changes which implicits get resolved ... that's the point. Odd that it's able to resolve something which is private though.
Alexandre Archambault
@alexarchambault
The type I look an implicit for (Map[String, argonaut.Json]) involves an ADT (argonaut.Json) whose subtypes are private
But implicitly is fine with this, whereas Lazy is not.
Miles Sabin
@milessabin
Ahh!
Alexandre Archambault
@alexarchambault
?? :-)
Miles Sabin
@milessabin
Lazy is a red herring here.
Alexandre Archambault
@alexarchambault
??
Miles Sabin
@milessabin
I think this is a Generic bug ... the Coproduct representation is including private subtypes.
Alexandre Archambault
@alexarchambault
why does the error pop up when using Lazy, and not when using implicitly then?
Miles Sabin
@milessabin
I think if a sealed trait has private subtypes it shouldn't have a Generic instance.
Alexandre Archambault
@alexarchambault
... I agree...
Miles Sabin
@milessabin
Because Lazy has allowed an implicit search path to be explored which wouldn't be without it.
Like I said, Lazy doesn't derive anything, it just controls divergence.
Alexandre Archambault
@alexarchambault
Shoudn't Lazy catch this error in a way or another?
Miles Sabin
@milessabin
Catch what? A bug in Generic?
Alexandre Archambault
@alexarchambault
Why is implicitly fine here?
Miles Sabin
@milessabin
Because Lazy has allowed an implicit search path to be explored which wouldn't be without it.
Alexandre Archambault
@alexarchambault
Yes, I read that... :-)
Miles Sabin
@milessabin
With implicitly we never go down the path that trips the bug.
Does that make sense?
Alexandre Archambault
@alexarchambault
I don't know enough of the internals of Lazy yet (I already tried to understand them though :-)
Miles Sabin
@milessabin
Would you mind trying out Generic on a sealed trait with private subtypes and see what happens?
Alexandre Archambault
@alexarchambault
I'll do that (I can't right now).
Miles Sabin
@milessabin
ie. materialize the Generic in a context which can access the trait but not the subtypes.
Alexandre Archambault
@alexarchambault
I'll try! I have to go, I'll keep you posted.
Thanks!
Miles Sabin
@milessabin
Thanks!
Miles Sabin
@milessabin
Just published shapeless-2.2.4 ... with fixes for most of your Generic prefix bugs.
Alexandre Archambault
@alexarchambault
@milessabin I'll do a release just for the sake of updating the shapeless dependency. And with milessabin/shapeless#418 fixed, there are lots of extra features to add in the next major release.
Miles Sabin
@milessabin
:+1:
Jamie Pullar
@JamiePullar
I have a particular use case for argonaut_shapeless, but find I am unable to resolve it. If I have a serialized form of an unknown subclass and I want to serialize it into its superclass. Using your example of BaseIntString, Im trying to do this Parse.decode[Base]. Is such a thing possible? Would it be possible for there to be a class name parameter to match against? """{"s":"test","i":3, "$class":"BaseIntString"}"""
Alexandre Archambault
@alexarchambault
@JamiePullar It's something that will be in the next version (I have some extra local developments for that, they're awaiting milessabin/shapeless#427)
I'd really like to pack a lot of new developments very soon (that are waiting for too long :-| )
A few developments are already on github thanks too @notxcain, but undocumented and not enough tested for now
Jamie Pullar
@JamiePullar
Great news, I'll keep an eye on it!
Miles Sabin
@milessabin
Sorry about the hold up ... I'm trying to get 2.12.0-M2 100% before cutting a new release.
Alexandre Archambault
@alexarchambault
@milessabin np, I changed and added quite a few things since the PR... I need to put that in shape.
Jeffrey N. Davis
@penland365
Hi everyone, I have what is probably an easy question - I have a DecodeJson operation that fails on decoding an Option[Float], but is succesful when the field is present. Example =>
case class Foo(bar: Int, baz: Int, moo: Option[Float])
implicit val decodeJson = implicitly[DecodeJson[Foo]]

Json =>

{
  bar: 3,
  baz: 1
}

fails

Alexandre Archambault
@alexarchambault
@penland365 It's fine with 0.4.0-SNAPSHOT (but not with 0.3.1, which is the last stable version)
A few things are going to change, this point happens to be fixed with these...
Hopefully, I'll do a 0.4.0 release soon (I should have some funployment soon :-)
So if you're fine with snapshots, use 0.4.0-SNAPSHOT (but other things may change too, be careful).
Alexandre Archambault
@alexarchambault
Another point: argonaut seems to require the field names to be quoted, I tested with
{
  "bar": 3,
  "baz": 1
}
Rodolfo Hansen
@kryptt
yes, the quotes are required in the json spec as well