Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 18 2022 19:35
    @SethTisue banned @lunaterra22
  • Sep 14 2022 18:08
    @SethTisue banned @discjock:matrix.org
  • Sep 12 2022 20:37
    @SethTisue banned @manuelzamoratetherbtcusa:matrix.org
  • Sep 06 2022 14:29
    @SethTisue banned @white_hat_hacker:minds.com
  • Sep 06 2022 14:29
    @SethTisue banned @alexchole:matrix.org
  • Aug 31 2022 17:03
    @SethTisue banned @andersonwatts7:matrix.org
  • Jul 19 2022 20:37
    @SethTisue banned @tonyobanon
  • Jan 02 2022 23:58
    @SethTisue banned @fakubishes:nerdsin.space
  • Dec 15 2021 05:01
    som-snytt commented #12516
  • Dec 15 2021 04:38
    SethTisue edited #1312
  • Dec 15 2021 04:38
    SethTisue opened #2273
  • Dec 15 2021 04:31
    jackkoenig opened #12516
  • Dec 15 2021 04:29
    SethTisue edited #1312
  • Dec 15 2021 04:28
    SethTisue edited #1312
  • Dec 15 2021 04:27
    SethTisue labeled #9831
  • Dec 15 2021 04:27
    scala-jenkins milestoned #9831
  • Dec 15 2021 04:27
    SethTisue labeled #9831
  • Dec 15 2021 04:27
    SethTisue opened #9831
  • Dec 15 2021 03:35
    som-snytt commented #11339
  • Dec 15 2021 03:27
    som-snytt labeled #12494
Luis Miguel Mejía Suárez
@BalmungSan
@tgeng please don't use threads.
Second, that is not a valid Functor.
At least not one represented using typeclasses.
You need the F parameter.
Ah well no.
Forget about it.
I am not used to extension methods.
tgeng
@tgeng
Thanks @BalmungSan ! I am not sure I follow. Anyway. Let me explain my second question.
Luis Miguel Mejía Suárez
@BalmungSan
No no
You are right.
I am just rusty with Scala 3.
I guess the extension makes it impossible to use the stdlib map
That is probably a bug.
No idea.
tgeng
@tgeng
Right, that's my second question.
Luis Miguel Mejía Suárez
@BalmungSan
Still I don't think people will use inner extensions.
For multiple reasons.
I guess most people will keep using the Scala 2 pattern of having the typeclass and the extensions defined separately.
tgeng
@tgeng
OK, so you mean define fmap just as a non-extension function and then define an extension map calling fmap?
Luis Miguel Mejía Suárez
@BalmungSan
Yup.
Or even just map
(sorry for the late response)
just like cats does as today.
tgeng
@tgeng
Got it! Makes sense! Thank you very much!!
Luis Miguel Mejía Suárez
@BalmungSan
But again, it may be just me not using Scala 3 a lot yet.
Is just that for a couple of things I have seen, that I think that most people will NOT use extension inside the typeclass definition.
tgeng
@tgeng
TBH, I have basically 0 experience with scala 2 so now that I kind of get that extension is a new thing that may not interact well with other language features.
Again, thank you for helping me!
rohith
@rohithbittu33_twitter
hi all, I am getting below error when I am running sbt dependencyBrowseTree. I made sure I am using sbt version=1.5.6 and also added enablePlugins(MiniDependencyTreePlugin) in my build.sbt. Can someone help me to solve this error?
stack trace is suppressed; run last Compile / dependencyBrowseTreeHTML for the full output
ritschwumm
@ritschwumm
@rohithbittu33_twitter what does last Compile / dependencyBrowseTreeHTML say? anything interesting in the stack trace?
Clinton Mead
@clintonmead
What do I need the type of x to be in the following code to be able to refer to x.f in g()? A.B didn't work.
trait A {
    trait B {
        def f: Unit
    }
}

object O {
    def g(x : ?): Unit {
        x.f
    }
}
nova
@nova99:matrix.org
[m]
A#B?
lambook
@lambook
Hello there, i want to write a method to concatenate many Byte arrays
def join(parts : Array[Byte]* ) : Array[Byte] ={...
is there already something to do that in scala ? thnx
Luis Miguel Mejía Suárez
@BalmungSan
@lambook parts.toArray.flatten
@clintonmead Note that your code means that for every instance of A there will be a new different type B so in order to properly reference B you first need an instance of a
Are you sure that is what you want?
Tim Spence
@TimWSpence

I was trying to convince scala 3 to recusrively flatten nested Eithers of some unknown depth but couldn’t figure out how to do it.
I got a match type that describes the expected output type:

case class Inv[T]()

type FlattenR[X] = Inv[X] match
  case Inv[Either[ValidationError, x]] => FlattenR[x]
  case Inv[x]                                                  => Either[ValidationError, x]

but couldn’t figure out a way around erasure to implement it at the value level?

D Cameron Mauch
@DCameronMauch
I can do something like list.sortBy(_.date) where date is java.util.Date, because there is an implicit Ordering[Date] in scope. But where is it?
implicit def ordered[A](implicit asComparable: AsComparable[A]): Ordering[A]
And ju.Date extends Comparable[Date]
D Cameron Mauch
@DCameronMauch
Ah, gotcha, thanks!
I wanted to do reverse, so I guess I could do something like implicitly[Ordering[Date]].reverse
Yep, that seems to work!
Luis Miguel Mejía Suárez
@BalmungSan
yup
Seth Tisue
@SethTisue
I have submitted a PR making Discord officially our main chat platform: scala/scala-lang#1312
this room (scala/scala) will remain open, but perhaps not forever
Seth Tisue
@SethTisue
weili96
@weili96
I love Scala!
Jim Newton
@jimka2001
Screenshot 2021-12-15 at 13.45.36.png