Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 06:26
    scala-steward opened #1188
  • Jun 17 19:25
    milessabin commented #1043
  • Jun 17 18:55
    milessabin commented #1043
  • Jun 17 18:39
    joroKr21 commented #1043
  • Jun 17 16:28
    Katrix commented #1043
  • Jun 14 08:01

    joroKr21 on main

    Update sbt to 1.5.4 Merge pull request #1187 from s… (compare)

  • Jun 14 08:01
    joroKr21 closed #1187
  • Jun 14 05:55
    scala-steward opened #1187
  • Jun 09 10:48

    joroKr21 on main

    Update sbt-scalajs, ... to 1.6.0 Merge pull request #1186 from s… (compare)

  • Jun 09 10:48
    joroKr21 closed #1186
  • Jun 08 16:55
    scala-steward opened #1186
  • Jun 02 07:05

    joroKr21 on main

    Update sbt-github-actions to 0.… Regenerate workflow with sbt-gi… Merge pull request #1185 from s… (compare)

  • Jun 02 07:05
    joroKr21 closed #1185
  • Jun 01 21:27
    scala-steward opened #1185
  • Jun 01 11:07

    joroKr21 on main

    Optimize sized.ToHList and ToSi… Merge pull request #1184 from j… (compare)

  • Jun 01 06:09

    joroKr21 on main

    Update sbt to 1.5.3 Merge pull request #1183 from s… (compare)

  • Jun 01 06:09
    joroKr21 closed #1183
  • Jun 01 05:51
    scala-steward opened #1183
  • May 31 19:14

    joroKr21 on 2.3

    Optimize sized.ToHList and ToSi… Merge pull request #1182 from j… (compare)

  • May 31 18:43
    joroKr21 commented #1099
Georgi Krastev
@joroKr21
Sounds like a good idea anyway :thumbsup:
Francesco Nero
@francesconero

Hello, I’m sorry if this is not the right place to ask but I was wondering if Shapeless had some built-in way of taking a case class and flattening it recursively to a Record (nested case classes or record-like objects as well). I saw the Adjoin typeclass but it seems to only work on hlists and coproducts.

In any case, thanks for such an amazing library!

Georgi Krastev
@joroKr21
Hi this is the right place and welcome! I'm not aware of an existing combinator within shapeless but there are different ways to do this. WDYM by a Record btw - a typed record (in shapeless this is just the result of LabelledGeneric) or more like a Map[String, Any]? I found an example how to flatten a tuple: https://github.com/milessabin/shapeless/blob/main/examples/src/main/scala/shapeless/examples/flatten.scala
Georgi Krastev
@joroKr21
Francesco Nero
@francesconero
Awesome, thanks! Yes I was thinking about a LabelledGeneric in fact, just not directly the result of applying it to a case class, but recursively flattened (so ending up with the spread out fields of the nested case classes if present). Thanks for the link, it’s a great starting point!
Georgi Krastev
@joroKr21
Note that this might lead to multiple fields with the same name
vonchav
@voonchav_gitlab
Hi Georgi, thanks for another refresh. After upgrading to v2.3.5 (from 2.3.4), my compilation now fails at the line of .tupled, with the following error:
Could not find an instance of Invariant for [+A]Product with java.io.Serializable.
I realize this is not enough info. Just wanted to post it here and see if it rings any bell.
I'll need to spend a bit more time debugging on my end and try coming up with a minimal reproducible example before opening an issue.
I did a quick scan on changes in 2.3.5 and noticed there is a backport (I'm guessing for v3) regarding tuple in this release. Not sure if it is related.
Artsiom Miklushou
@mikla
Also have issues with resolving implicits after upgrading to 2.3.5. Trying to break it down and make a minimal reproduction case.
Georgi Krastev
@joroKr21
There could be bugs, this is a rather big release because there were many changes piled up over time. Please open issues to report any problems :pray:
@voonchav_gitlab are you using kittens to derive Invariant?
If you are using kittens please upgrade to 2.3.0
vonchav
@voonchav_gitlab
Thanks Georgi. I use Shapeless mostly. But I do have kittens in the dependency list (I'm experimenting some derivation with kittens). I upgraded both Shapeless and Kittens yesterday. My Shapeless code does some transformation with a tuple of refined types, basically going from a pair of Option[Either[(A, <refined_type>]] to ValidatedNel[A, (Option[<refined_type>], Option[<refined_type>])] (where ValidatedNel is from cats)... It works with Shapeless 2.3.4 (and Kittens 2.2.2) :) ... Yeah, I'll look into a bit more later today and see if I can narrow down the issue and create a small example to reproduce the problem.
vonchav
@voonchav_gitlab
I forgot to answer your question, Georgi. In the module that fails the compilation, it doesn't use kittens (I don't have any imports from kittens). Only Shapeless and cats. So I don't think I'm using kittens to derive Invariant (even though I have kittens in the project).
Georgi Krastev
@joroKr21
I think I already found one bug
Miles Sabin
@milessabin
@/all Typelevel is having another go at moving community discussion from gitter to discord. The general sense is that gitter is sufficiently dysfunctional for enough people (and discord sufficiently functional) to make a move worthwhile.
This room isn't going to go away any time soon, but I think that over time the centre of gravity will most likely shift to discord.
If you'd like to join the TL discord this link will take you there: https://discord.gg/EdKTAwv7.
Geovanny Junio
@geovannyjs
https://discord.gg/EdKTAwv7 => Invite invalid
mpilquist
@mpilquist:matrix.org
[m]
Geovanny Junio
@geovannyjs
Same result, maybe something wrong in my side, it is my first attempt with Discord
mpilquist
@mpilquist:matrix.org
[m]
huh
Geovanny Junio
@geovannyjs
Sorry the noob mistake, my email was not verified yet, everything fine now
mpilquist
@mpilquist:matrix.org
[m]
ah cool!
Geovanny Junio
@geovannyjs
Thank you
Georgi Krastev
@joroKr21
@voonchav_gitlab @mikla I think this is most probably the bug you were experiencing: milessabin/shapeless#1152 - I am very tempted to just cut another release but if you have a way to test if it works for you or for me to reproduce I would hold off.
Found this bug in the update PR for pureconfig: pureconfig/pureconfig#1037
vonchav
@voonchav_gitlab
@joroKr21 Is there a snapshot build that I can download? Alternatively, I can provide the code. Probably need to reproduce the problem in Ammonite. I wonder if I can reproduce it in scastie :)
Georgi Krastev
@joroKr21
Hmm no, looks like we publish snapshots only from main
Let me fix that
vonchav
@voonchav_gitlab
I keep getting this error from Scastie, no matter what version of cats I specify:
sbt.librarymanagement.ResolveException: Error downloading org.typelevel:cats_2.13:2.4.2 Not found
Georgi Krastev
@joroKr21
I think you need cats-core
vonchav
@voonchav_gitlab
yea, probably. I end up importing kittens instead... That's good. I just need to import 2.2.2 and 2.3.0 to see if I can reproduce the problem with 2.3.0. Almost done.
vonchav
@voonchav_gitlab
Alright, I can reproduce the problem in Scastie: https://scastie.scala-lang.org/vELbT0QtQramsGbHMAsW0w
If you go to Build Settings and change kittens to 2.2.2, it will compile and the values will be asserted.
Georgi Krastev
@joroKr21
Awesome - in the meantime there is a snapshot 2.3.5+6-1b1fb4f0-SNAPSHOT
vonchav
@voonchav_gitlab
Cool. Going to try it. Thanks.
Georgi Krastev
@joroKr21
That looks like a different problem though. cats also gives you map on tuple - mapping on the last element!
I have no clue how it worked before but now they are clashing
vonchav
@voonchav_gitlab
You're right. cats has map on tuple too.... I didn't think about clashing until you pointed it out.
Maybe I can rewrite my stuff. I wrote that a while ago. Perhaps I can find a simpler way and avoid the clashing.... At the same time, I too wonder how it wasn't a problem before :)
Georgi Krastev
@joroKr21
I think somehow the shapeless map was considered more specific before
Because it had P <: Product
Now it's P: IsTuple
vonchav
@voonchav_gitlab
Right. I think I can use FunctionK for the first transformation.
Georgi Krastev
@joroKr21
We could make it P <: Product: IsTuple
I will sleep on it I'm off now
vonchav
@voonchav_gitlab
That looks fine to me but I don't have the knowledge you have. :)
Thanks a lot, Georgi. Have a good night.
Georgi Krastev
@joroKr21
You too :wave:
Georgi Krastev
@joroKr21

We could make it P <: Product: IsTuple

That does't work because it makes it ambiguous with ProductOps - so I'm afraid we can't resolve this 3-way clash (TupleOps <-> ProductOps <-> FunctorOps from cats)

Georgi Krastev
@joroKr21
I think the only other option would be to add an alias for map