Where communities thrive


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

    julienrf on main

    Inkuire docs Merge pull request #2125 from K… (compare)

  • 08:30
    julienrf closed #2125
  • 08:12
    KacperFKorban commented #2125
  • 08:11
    KacperFKorban synchronize #2125
  • 08:11
    KacperFKorban synchronize #2125
  • 08:04
    KacperFKorban review_requested #2125
  • 08:03
    KacperFKorban synchronize #2125
  • 08:01
    KacperFKorban synchronize #2125
  • 08:01
    KacperFKorban synchronize #2125
  • 08:00
    KacperFKorban synchronize #2125
  • 08:00
    KacperFKorban synchronize #2125
  • 08:00
    KacperFKorban synchronize #2125
  • 07:57
    KacperFKorban synchronize #2125
  • Jul 27 23:42

    SethTisue on 2.13.x

    update dependencies.txt (compare)

  • Jul 27 23:40
    SethTisue milestoned #5606
  • Jul 27 23:40
    SethTisue demilestoned #5606
  • Jul 27 23:40
    SethTisue labeled #5606
  • Jul 27 23:40
    SethTisue assigned #5606
  • Jul 27 22:36

    SethTisue on 2.13.x

    akka-http is green now on JDK 17 (compare)

  • Jul 27 22:33

    SethTisue on 2.13.x

    fix macwire on JDK 17 (#1462) (compare)

Gavin Bisesi
@Daenyth
the types look mostly the same
nafg
@nafg
I'm wondering about what to do then -- fork and publish to my bintray? Just copy-paste into my app? Find out if the author can accept and publish a PR?
Gavin Bisesi
@Daenyth
I'd just copy-paste it
it's one file
and the package object has one type alias defined
Gavin Bisesi
@Daenyth
@nafg I was also asking in the http4s channel, they did mention a PR adding it directly to the library itself would be acceptable
:wave: have a good weekend all :)
nafg
@nafg
not sure if I should trust 3 year old hand-rolled encryption code tbh
Ghost
@ghost~54f837fe15522ed4b3dcd6a3
I there a way to automatically derive a BsonTransformer for the MongoDB Driver without custom implementation via macros or shapeless?
Martijn Hoekstra
@martijnhoekstra
I wouldnt trust machine generated encryption code over hand rolled
At least, I think I wouldnt? How does machine generated encryption code work?
Soren
@srnb_gitlab
What are other languages with literal types besides Idris?
ritschwumm
@ritschwumm
typescript, i guess
Rob Norris
@tpolecat
You can do it in Haskell. And any dependently-typed language, of which Idris is one.
Rob Norris
@tpolecat
[error] Multiple repositories are found:
[error] [orgtpolecat-1125] status:open, profile:org.tpolecat(23052d71604fff) description: Implicitly created (auto staging).
[error] [orgtpolecat-1126] status:open, profile:org.tpolecat(23052d71604fff) description: Implicitly created (auto staging).
[error] Specify one of the repository ids in the command line
[error] java.lang.IllegalStateException: Found multiple staging repositories
One of my builds started doing this when doing sonatypeReleaseAll. What have I done and how do I fix it?
I went in and dropped them in the Nexus UI and tried again and it did it again.
Seth Tisue
@SethTisue
fwiw: when we're publishing Scala modules we almost always end up with multiple staging repos, a nondeterministic number of them. usually we just release them all at once through the Sonatype web and it's fine. some percentage of time, the files for a single target end up split between two staging repos, which can then neither be closed or released, and we have to run that target (and any targets that ended up mixed up in the affected repos) again
if you're ending up with multiple staging repos when you didn't before, it might be timing related, like maybe your build crossed some sort of threshold on how long it takes between one target and the next
the good news is that it might be fine to just release the multiple repos via the web UI, and not use sonatypeReleaseAll
anyway, I have only very partial understanding of this stuff, so perhaps someone who understands it better will have better advice for you.
</fwiw></ihavenoideawhatimdoing>
Li Haoyi
@lihaoyi
the multiple staging repos thing is a sbt quirk. Mill creates one staging repo, and always releases just that, without races in the presence of concurrent workflows
not sure what SBT is doing; mill’s code was written just following the sonatype api docs and it seems to do what i’d expect
Rob Norris
@tpolecat
Hell. Ok. Is it sbt or sbt-sonatype?
The plugin surely.
Seth Tisue
@SethTisue
it seems the ticket of record is xerial/sbt-sonatype#83
that's with +publishSigned though. often the repos I work in aren't using +, they're using the Travis-CI matrix to do the different parts. so idk
Rob Norris
@tpolecat
Nexus is the JIRA of package repositories. We need our own, it’s just absolute hell.
OlegYch
@OlegYch
who's going to support our version of hell
Rob Norris
@tpolecat
Scala Center?
They’re looking for ideas!
This has worked fine for me for many prior releases. It just started happening.
I feel like I’m taking crazy pills. I had a different random automation failure yesterday.
Rob Norris
@tpolecat
I need to switch to a language nobody uses so I won’t have to worry about this stuff.
I guess I could try Mill. @lihaoyi is there a way to run paradox and push stuff to gh-pages?
Luis Miguel Mejía Suárez
@BalmungSan

Hi,

I have something like this:

trait Factory[F[_]] {
  type R[A]
  def create[A](a: => A): R[A]
}

object Factory {
  type Aux[F[_], _R[_]] = Factory[F] { type R[A] = _R[A] 

  type Id[A] = A

  implicit val FutureFactory: Factory.Aux[Future, Id] =
    new Factory[Future] {
      override final type R[A] = A
      override final def create[A](a: => A): A = a
    }
}

object Driver {
  def driver[F[_]]: DriverPartiallyApplied[F] = new DriverPartiallyApplied(dummy = true)

  private final class DriverPartiallyApplied[F[_]](private val dummy: Boolean) extends AnyVal {
    def apply[R[_]](uri: String)(implicit F: Factory.Aux[F, R]): R[Driver[F]] =
      F.create(...)
  }
}

Now, on another project I would like to do this:

val driver: Driver[Future] = Driver.driver[Future]("uri")

But that does not compile with this error:

found: [R[_]]R[neotypes.Driver[scala.concurrent.Future]]
required: neotypes.Driver[scala.concurrent.Future]

If I leave out the explicit type signature, it works as expected. The compiler is able to figure out latter that driver is a Driver[Future].

Anyone knows how can I fix that?

Sciss
@Sciss

Is it possible to define "negative implicits", like

trait Ex[+A]
case class Const[A](value: A) extends Ex[A]

implicit def const[A](x: A): Ex[A] = Const(x)

such that const cannot be called when A <: Ex[_] ? I have no way to put an upper bound on A, e.g. it could be Int, String, java.io.File, ... types over which I have no control.

Luis Miguel Mejía Suárez
@BalmungSan
@Sciss Can not test it right now, but I believe you can use Shapeless =:!=.
Something like implicit def const[A](x: A)(implicit ev: A =:!= Ex[_]): Ex[A] = Const(x)
Sciss
@Sciss
sounds good, I wonder how that's implemented. Of course can't google =:!=, any pointer to the relevant documentation?
must be a macro, I guess?

Perhaps easier solution would be if I have

   def runWith(map: Ex[Map[String, _]]) = ???

but I need to restrict the value types in the map, for example by coming with a type class; the problem being that the value types may vary (it's a heterogeneous map, Scala's arch enemy)

Sciss
@Sciss
So I want a Map[String, Int] to be able to be lifted, but not Map[String, Ex[_]].
So perhaps a simpler question is, "how can I place constraints on the value types of a heterogeneous map", with emphasis on the user being able to type it with literals without the need to use type ascriptions etc.

For instance:

def title: Ex[String]

trait Runner {
  def runWith(attr: Ex[Map[String, _]]): Unit
}

def r: Runner

r.runWith(Map("foo" -> 123, "bar" -> title))

and what I need to enforce is the expansion

Map(Const("foo") -> Const(123), Const("bar") -> title)

and prevent

Const(Map("foo" -> 123, "bar" -> title /* bad */))
Sciss
@Sciss
I have the hunch that I should introduce trait ExMap[K, V] extends Ex[Map[K, V]] so that I can restrict lifting from Map constructor.
Sciss
@Sciss
Like how can I get rid of the : Ex[String] annotations here:
trait ExMapTest3 {
  trait Ex[+A]

  implicit def const[A](in: A): Ex[A]

  implicit def liftMap[K, V](m: Map[Ex[K], Ex[V]]): ExMap[K, V]

  trait ExMap[K, V] extends Ex[Map[K, V]]

  def runWith(m: ExMap[String, Any]): Unit

  def title: Ex[String]

  runWith(
    Map(("foo": Ex[String]) -> ("bar": Ex[String]))  // not nice
  )

  runWith(
    Map(("foo": Ex[String]) -> title)
  )
}
Sciss
@Sciss

I guess the best would be to just surrender to

implicit def const[A: Permitted](in: A): Ex[A]

and give dozens of type classes for all primitives etc.; perhaps I could use marker trait scala.Immutable for types I control.

Sciss
@Sciss

along these lines

  implicit def const[A: Value](x: A): Ex[A] = Const(x)

  object Value {
    implicit object anyVal    extends Value[AnyVal  ]
    implicit object string    extends Value[String  ]
    implicit object file      extends Value[File    ]
    implicit object spanLike  extends Value[SpanLike]

    implicit def tuple  [A: Value, B: Value]: Value[(A, B)] = null

    implicit def option [A: Value]: Value[Option[A]] = null
    implicit def seq    [A: Value]: Value[Seq   [A]] = null
  }
  trait Value[-A]

0: Ex[Int]  // ok
Some("foo"): Ex[Option[String]]  // ok
Some("foo": Ex[String]): Ex[Option[Ex[String]]]   // forbidden

Is there any issue with = null? Would like to avoid instantiations for throw away witnesses.