Discord is now Scala’s main chat platform. Please join us at https://discord.com/invite/scala
sbt publish
will push the maven style project to one remote repository if the build agent is a Jenkins and a different remote repository if the build agent is a GitHub action. I've spent about 6 hours on this today and I don't feel like I really understand much more about SBT and how to modify the behavior of sbt publish
. Does anyone here have good example sbt projects or suggestions for learning more in regard to what I am trying to do?
#tooling
channel of the discord server.
publishTo := { if (isJenkins) Some(...) else Some(...) }
x
and a deserialized class object o
fetched from a database. The fetch is polymorphic in that the object can be one of two distinct types, I don't know which one ahead of time. o
has a method .foo(x)
that expects a specific type of a value, depending on the type of o
, and for that it has a safeguard method transparent inline cast[A](a: A) = inline erasedValue[A] match {...}
. The question: given that the object is only known at runtime, is inlining going to do any good, or am I grossly misunderstanding it?
items.foreach(item => mapBuilder.updateOrSet(item.key, set = 0, update = n => n + 1))
items.foldMap(item => Map(item.key -> 1))
Builder
, which has no specific knowledge of maps for instance. So when you do Map.newBuilder[String, Int]
you end up with a Builder[(String, Int), Map[String, Int]]
, which has no knowledge of maps specifically.
MapBuilder
is just a mutable map that also has a mutable version of the method I explained above,
Builders
are intended for the stdlib itself, not really for users.
Map
with the method you want.
mutable.Map
or java.util.Map
, but I was specifically looking for something to build an immutable map, but avoiding the overhead. And before you say "the overhead might not matter", then yes, you're right, but I was looking for a way to do it none the less :)
groupMapReduce
which are optimized under the hood.