Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:01

    joroKr21 on main

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

  • 08:01
    joroKr21 closed #1187
  • 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
  • May 31 18:41
    joroKr21 commented #1099
  • May 31 18:25
    joroKr21 commented #1099
  • May 31 17:58
    joroKr21 closed #509
  • May 31 15:59
    joroKr21 labeled #1181
  • May 31 11:38
    joroKr21 commented #1181
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
Georgi Krastev
@joroKr21
But there are many other methods like flatMap and foldLeft that would need aliases
vonchav
@voonchav_gitlab
@joroKr21 I managed to get my code to work with kittens 2.3.0 by having the "right" implicit in scope only. Not sure if this is just a hack :)
I updated the scastie: https://scastie.scala-lang.org/H8zcJSIkT0mMvK6kSoutkw (sorry, let me know if you need the original version)
Georgi Krastev
@joroKr21
Yeah that's fine it's not a hack
Totally reasonable to do this when you have clashing syntax
vonchav
@voonchav_gitlab
Cool, I think I'm good. I'm in the process of upgrading shapeless and kittens :) It's good to know the root cause. Thank you very much for your help!
Miles Sabin
@milessabin
FYI, there should be a stable release of shapeless 3 (shapeless-deriving module) for Scala 3 to coincide with ScalaCon.
nafg
@nafg
When is that?
Clint Combs
@ClintCombs
What is K0 here? I get "Not found: K0" when attempting something like this in my own code with Scala 3.0.0-RC3: https://github.com/milessabin/shapeless/blob/v3.0.0-M4/modules/deriving/src/test/scala/shapeless3/deriving/type-classes.scala#L48
Miles Sabin
@milessabin
(Discussion is happening in the Typelevel discord)
Miles Sabin
@milessabin
Just published #shapeless 3.0.0 for #Scala 3.0.0: https://github.com/milessabin/shapeless/tree/shapeless-3
(Most discussion will be on the Typelevel discord)
Miles Sabin
@milessabin
shapeless 3 now has it's own repo in the Typelevel GitHub organisation: https://github.com/typelevel/shapeless-3 :tada:
Miles Sabin
@milessabin
Just published #shapeless 3.0.1 for #Scala 3.0.0 and #Scalajs 1.5.
Alex Henning Johannessen
@ahjohannessen
@milessabin Awesome :) How would I go about defining a Typeable for cats.NonEmptyMap. In shapeless 2 I have something like:
  // Adapted from `shapeless.Typeable.genMapTypeable`.
  implicit def typeableForNonEmptyMap[K, V](
    implicit cM: ClassTag[NonEmptyMap[_, _]],
    tK: Typeable[K],
    tV: Typeable[V]
  ): Typeable[NonEmptyMap[K, V]] = new Typeable[NonEmptyMap[K, V]] {

    def cast(t: Any): Option[NonEmptyMap[K, V]] =
      if (t == null) None
      else if (cM.runtimeClass isAssignableFrom t.getClass) {
        val m = t.asInstanceOf[NonEmptyMap[Any, Any]]
        if (m.toSortedMap.forall(_.cast[(K, V)].isDefined)) Some(t.asInstanceOf[NonEmptyMap[K, V]]) else None
      } else None

    def describe = s"${cM.runtimeClass.getSimpleName}[${tK.describe}, ${tV.describe}]"
  }

}
Alex Henning Johannessen
@ahjohannessen
I get this:
[error] -- Error: /Users/ahjohannessen/Development/Work/subsidy-support/marshal/src/test/scala-3/support/marshal/typeables.scala:18:51 
[error] 18 |      val cm     = m.cast[NonEmptyMap[Int, String]]
[error]    |                                                   ^
[error]    |No Typeable for parametrized type cats.data.NonEmptyMapImpl.Type[scala.Int, scala.Predef.String]
[error]    | This location contains code that was inlined from typeables.scala:18
[error]    | This location contains code that was inlined from typeable.scala:244
Victor Viale
@Koroeskohr
hello friends ! I was wondering if there was a way to add a LUBConstraint to a ProductArgs output? I've been playing with it for a bit but I'm hitting a wall with the Dynamic method signature that's not being respected
+- what I'm trying to achieve
object foo extends ProductArgs {
  def applyProduct[L <: HList](l: L)(implicit LUBC: LUBConstraint[L, Bar]): Job[L] = Job(l)
}
Miles Sabin
@milessabin
Hi folks ... your occasional reminder that shapeless discussion has moved to the Typelevel Discord: https://discord.gg/bSQBZA3Ced
Victor Viale
@Koroeskohr
oh... thanks