Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 05:19
    eed3si9n assigned #12391
  • 05:18
    eed3si9n commented #12391
  • 05:18
    scala-jenkins milestoned #9621
  • 05:18
    eed3si9n opened #9621
  • 03:18
    SethTisue edited #1400
  • 03:17
    SethTisue synchronize #1400
  • 00:35
    SethTisue commented #1400
  • 00:35
    SethTisue commented #1400
  • 00:34
    SethTisue commented #1400
  • May 08 23:39
    SethTisue milestoned #12392
  • May 08 23:39
    SethTisue assigned #12392
  • May 08 23:39
    SethTisue labeled #12392
  • May 08 23:27
    scala-jenkins milestoned #9620
  • May 08 23:27
    neko-kai opened #9620
  • May 08 23:12
    neko-kai commented #9605
  • May 08 23:11
    neko-kai synchronize #9605
  • May 08 23:06
    scala-jenkins milestoned #9619
  • May 08 23:06
    neko-kai opened #9619
  • May 08 23:04
    neko-kai edited #12392
  • May 08 23:04
    neko-kai opened #12392
Hanns Holger Rutz
@Sciss
When over four hundred lines, you'll have to add a modifier to become claes oldenburg, otherwise compiler will reject
som-snytt
@som-snytt
Other folks may have heard that reference going over my head, but I googled it. In other news, people still ask questions on SO where the answer is try -Xlint for a hint. So maybe Scala 3 should have -Xhint instead. All the linting should be 3rd party anyway. I didn't PR scala 2 options for scala 3 such as -Vprint, but I am tempted to do it for the sake of -Xhint.
Hanns Holger Rutz
@Sciss
with Albanian pronounciation "ˈdʒint"
Guillaume Martres
@smarter
Some(1).empty returns an Iterable[Int] whose value is Nil, I assume that's due to the implicit conversion and it's now too late to fix in 2.13 ?
Seth Tisue
@SethTisue
@smarter I have long been interested in deprecating option2iterable. we've been around about it many times. tickets include scala/scala#8038, scala/collection-strawman#48, scala/bug#7941, and the longer you look the more you'll find
Guillaume Martres
@smarter
but my flatMap :)
Seth Tisue
@SethTisue
@smarter we actually deprecated it once and that got reverted: scala/scala#8106
Guillaume Martres
@smarter
maybe we should just overload flatMap to accept Options
ah, or does flatMap work because Option is IterableOnce?
Seth Tisue
@SethTisue
over the years Option has accumulated more methods. I can't tell you offhand whether adding .empty with the right type would break bincompat, and/or if it would fail to pass PR review because of source compat concerns

does flatMap work because Option is IterableOnce

I can't answer offhand without re-reading those discussions, maybe someone else knows offhand

Princess | April
@NthPortal
there've been some discussions on Contributors too, I believe
Princess | April
@NthPortal
I have been strongly of the opinion that the fact that it only works one way, with for(i <- List(1); j <- Some(1)) {} compiling but for(i <- Some(1); j <- List(1)) {} not, is a good reason to remove the conversion, so it's consistent at least. except now Option extends IterableOnce, so that wouldn't even help anymore
Jasper Moeys
@Jasper-M

ah, or does flatMap work because Option is IterableOnce?

IIRC that is the main reason why Option now extends IterableOnce

Princess | April
@NthPortal
it worked before, to be clear. I think there was just a desire to have it work without a conversion? I don't remember
Jasper Moeys
@Jasper-M
Maybe the conversion didn't work as well anymore because of the new design with all the overloads?
Rob Norris
@tpolecat
The ability to mix type ctors in a for-comprehension is a mixed bag I think. It’s a convenient generalization but it can be confusing to understand what it means, especially for beginners who can’t desugar the syntax in their heads.
Jasper Moeys
@Jasper-M
I've become convinced that the real problem is that def collect[B](f: A => Option[B]): List[B] doesn't exist.
Martijn
@martijnhoekstra:matrix.org
[m]
That's a spicy conviction
Jasper Moeys
@Jasper-M
I almost considered tweeting it
Rob Norris
@tpolecat
Well I mean, it doesn’t exist because you can use flatMap to do it.
But cats gives you mapFilter (from FunctorFilter) which is exactly this operation, but more general and law-abiding.
Eric K Richardson
@ekrich
Maybe in newer stdlib we could benefit from some of this?
Rob Norris
@tpolecat
There's not really any way to bring cats-like abstractions into stdlib, nor any point in my opinion. If you want to use lawful abstractions just use cats.
The stdlib approach is to have collect and generalized flatmap way up in the class hierarchy, which works fine for most people and is consistent with the design goals for stdlib.
Eric K Richardson
@ekrich
ok, I guess that would help then.
som-snytt
@som-snytt
Quite surprised no one has complained about the language import error message? If it just said import language.foo, it would be cut/paste. Maybe everyone's IDE offers a "quick fix" link.
som-snytt
@som-snytt
Surely this is annoying, reporting warnings from right to left instead of top-down:
[error] .../scala/test/scalacheck/CheckEither.scala:17:34: method get in class RightProjection is deprecated (since 2.13.0): Use `Either.getOrElse` instead
[error]     case Left(a) => e.swap.right.get == a
[error]                                  ^
[error] .../scala/test/scalacheck/CheckEither.scala:17:28: method right in class Either is deprecated (since 2.13.0): Either is now right-biased, use methods directly on Either
[error]     case Left(a) => e.swap.right.get == a
[error]                            ^
som-snytt
@som-snytt
After enjoying improved repl printing scala/scala#8885 I can't go back. And that doesn't even include improvements in dotty repl or ammonite.
So instead of either.right.filterToOption(p), either.filterOrElse(p, z).toOption? I don't use this API and I don't read comments by people using the API, but I would expect they would have complained by now.
som-snytt
@som-snytt
tpolecat is my safe zone. Maybe because he doesn't talk too fast, and he's like it's hip to be square. Also it's OK to still be learning. While reading Plato, I hear Socrates as a tpolecat talk. Socrates never makes you feel small, even if he admits that everyone he talks to winds up looking ridiculous. "Let's live and die in the pursuit of virtue, and not what you believe, which isn't worth a thing, my dear Callicles," he concludes. But he means it nicely!
Rob Norris
@tpolecat
That’s very kind. I have a millennial consultant who helps me combat squareness but it’s a daily struggle.
Jasper Moeys
@Jasper-M
I get errors when I build 2.12.x locally:
[error] scala/src/library/scala/collection/immutable/TreeMap.scala:407:17: type arguments [_] do not conform to class SortedMapFactory's type parameter bounds [CC[A, B] <: scala.collection.SortedMap[A,B] with scala.collection.SortedMapLike[A,B,CC[A,B]]]
[error]       case cbf: SortedMapFactory[_]#SortedMapCanBuildFrom[_,_] => {
[error]                 ^
[error] scala/src/library/scala/collection/immutable/TreeSet.scala:267:17: type arguments [_] do not conform to class SortedSetFactory's type parameter bounds [CC[A] <: scala.collection.SortedSet[A] with scala.collection.SortedSetLike[A,CC[A]]]
[error]       case cbf: SortedSetFactory[_]#SortedSetCanBuildFrom[_] => {
[error]                 ^
Seth Tisue
@SethTisue
@Jasper-M I'm not able to reproduce that. I did git clean -ffxd followed by sbt Test/compile, no errors. and https://github.com/scala/scala/actions/runs/789714479 was green
Jasper Moeys
@Jasper-M

What I did was

$ git clone git@github.com:Jasper-M/scala.git
$ cd scala
$ git remote add upstream 'git@github.com:scala/scala.git'
$ git checkout 2.12.x
$ git pull upstream 2.12.x

Also tried to git clean to be sure, but still nothing.

Jasper Moeys
@Jasper-M
No issues on my 2.13.x branch
Seth Tisue
@SethTisue
weird. beats me
Martijn
@martijnhoekstra:matrix.org
[m]
Do you get the same when you delete your 2.12 branch and pull it again from upstream?
Maybe you have a bad commit locally
Jasper Moeys
@Jasper-M
Unless something in git is corrupted somehow, I don't think that that can be the case. According to github my branch is up to date with the scala/scala one. But I'll give it a try when I get back to my computer.
Rob Norris
@tpolecat
you can git clean -xdf to blow away anything local that's not in the repo
i call it the cleansing fire of justice
Jasper Moeys
@Jasper-M
I had semanticdbEnabled set to true globally
Haven't looked into if it's a version issue or semantic db in general or rangepos, but disabling it solved it
Seth Tisue
@SethTisue
@Jasper-M ah, ~/.sbt/1.0/*.sbt, where build reproducibility goes to die
if it were happening on 2.13.x, I might be motivated to dig into it since it sounds like something that could affect Metals usage, but if it's 2.12.x-only, then 🤷‍♂️
som-snytt
@som-snytt
Suddenly pos/t8146b.scala started hanging for me. Deleting .cache and .sbt worked. partest certainly ran to completion w/in last month. Today had more time to look at something because day job was eliminated and I needed to keep my hands busy.
som-snytt
@som-snytt
I just learned "fomite" which I would have assumed was fommil's ammonite repl, something you could invoke from emacs. PSA it's not a github project name yet.