Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 27 16:43

    joroKr21 on main

    Update slf4j-nop to 2.0.5 (#129… (compare)

  • Nov 27 16:43
    joroKr21 closed #1293
  • Nov 26 17:38
    scala-steward opened #1293
  • Nov 24 22:35

    joroKr21 on main

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

  • Nov 24 22:35
    joroKr21 closed #1291
  • Nov 24 22:14
    joroKr21 synchronize #1291
  • Nov 24 22:13
    joroKr21 closed #1288
  • Nov 24 22:13

    joroKr21 on main

    Update junit-plugin, junit-runt… (compare)

  • Nov 24 22:13
    joroKr21 closed #1292
  • Nov 24 18:03
    scala-steward commented #1288
  • Nov 24 18:03
    scala-steward opened #1292
  • Nov 24 18:03
    scala-steward opened #1291
  • Nov 19 21:17

    joroKr21 on main

    Update slf4j-nop to 2.0.4 (#129… (compare)

  • Nov 19 21:17
    joroKr21 closed #1290
  • Nov 18 20:54
    scala-steward opened #1290
  • Nov 15 06:50
    joroKr21 commented #1286
  • Nov 15 06:48
    joroKr21 commented #1287
  • Nov 15 06:41
    joroKr21 synchronize #1288
  • Nov 15 06:41

    joroKr21 on main

    Update sbt to 1.8.0 (#1289) (compare)

  • Nov 15 06:41
    joroKr21 closed #1289
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
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.
Naftoli Gugenheim
@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
Tharindu Galappaththi
@TharinduDG

When I'm trying to start a spark-shell(spark 3.0.1) with a custom jar I'm getting this error

java.lang.NoSuchMethodError: 'shapeless.DefaultSymbolicLabelling shapeless.DefaultSymbolicLabelling$.instance(shapeless.HList)'
  at com.cognite.sdk.scala.v1.GenericClient$anon$lazy$macro$5$1.inst$macro$1$lzycompute(Client.scala:202)
  at com.cognite.sdk.scala.v1.GenericClient$anon$lazy$macro$5$1.inst$macro$1(Client.scala:202)
  at com.cognite.sdk.scala.v1.GenericClient$.<init>(Client.scala:202)
  at com.cognite.sdk.scala.v1.GenericClient$.<clinit>(Client.scala)
  at cognite.spark.v1.DefaultSource$.$anonfun$getProjectFromAuth$1(DefaultSource.scala:393)
  at cats.effect.internals.IORunLoop$.step(IORunLoop.scala:302)
  at cats.effect.IO.unsafeRunTimed(IO.scala:338)
  at cats.effect.IO.unsafeRunSync(IO.scala:256)
  at cognite.spark.v1.DefaultSource$.getProjectFromAuth(DefaultSource.scala:396)
  at cognite.spark.v1.DefaultSource$.$anonfun$parseRelationConfig$4(DefaultSource.scala:315)
  at scala.collection.MapLike.getOrElse(MapLike.scala:131)
  at scala.collection.MapLike.getOrElse$(MapLike.scala:129)
  at org.apache.spark.sql.catalyst.util.CaseInsensitiveMap.getOrElse(CaseInsensitiveMap.scala:30)
  at cognite.spark.v1.DefaultSource$.parseRelationConfig(DefaultSource.scala:315)
  at cognite.spark.v1.DefaultSource.createRelation(DefaultSource.scala:89)
  at cognite.spark.v1.DefaultSource.createRelation(DefaultSource.scala:62)
  at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:344)
  at org.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:297)
  at org.apache.spark.sql.DataFrameReader.$anonfun$load$2(DataFrameReader.scala:286)
  at scala.Option.getOrElse(Option.scala:189)
  at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:286)
  at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:221)

I'm using circe 0.14.1 which seems to use shapeless 2.3.6.

I would appreciate any help to resolve this issue
Grigory
@pomadchin
@TharinduDG hey; shade shapeless in your project or bump the shapeless version up in the Spark class path
Georgi Krastev
@joroKr21
I didn't know Spark has Shapeless in the classpath
Grigory
@pomadchin
@joroKr21 yea they do have, that is a transitive dep
Both Spark 3.0 and 3.1 depend on some old shapeless version
that is also true for cats-kernel ):
Yuriy Badalyantc
@LMnet
Hi everybody. Why after MapValues I can't refer to the same field in the repr: https://scastie.scala-lang.org/LMnet/gENLvGZySJSr8Lg8zW4Vsw/7 ?
noti0na1
@noti0na1
noti0na1.png
Alberto Gregoris Herrero
@agregoris-zd
Hello everybody. Simple question, if I have a type type ValidatedFormat[T] = ValidatedNec[String, T] and a case class case class C(a: String, b: Int). is there any way to obtain a generic representation of type Repr = ValidatedFormat[String] :: ValidatedFormat[Int] :: shapeless.HNil?
nrktkt
@nrktkt:matrix.org
[m]

Hi there, I've got some code that isn't working (I assume due to some compiler implicit search depth limitations) and was hoping someone here could identify what might be going wrong.
Basically the code derives a typeclass to convert JSON AST to a domain case class. In the process it looks for annotations and default values on the fields.
The problem is that after about 32 simple fields recordFromJson (second link) stops resolving.

relevant code:
https://github.com/kag0/ninny-json/blob/defaults/ninny/src-2/io/github/kag0/ninny/FromJsonAutoImpl.scala
and
https://github.com/kag0/ninny-json/blob/defaults/ninny/src-2/io/github/kag0/ninny/VersionSpecificFromJsonInstances.scala