Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 15:56

    github-actions[bot] on gh-pages

    deploy: fb8302b35246aa774b49707… (compare)

  • 15:50

    armanbilge on 0.23

    Call Chunk.toByteBuffer directly Merge pull request #6716 from C… (compare)

  • 15:50
    armanbilge closed #6716
  • 15:50
    armanbilge commented #6716
  • 15:39
    armanbilge commented #6732
  • 15:00

    danicheg on series

    (compare)

  • 14:48
    rossabaker closed #750
  • 14:29

    armanbilge on flake-lock-19

    (compare)

  • 14:09
    grouzen edited #6732
  • 13:39

    danicheg on sbt-giter8-0.16.0

    (compare)

  • 13:39

    danicheg on 0.23

    Update sbt-giter8 to 0.16.0 Merge pull request #291 from ht… (compare)

  • 13:39
    danicheg closed #291
  • 13:01
    http4s-steward[bot] opened #291
  • 13:01

    http4s-steward[bot] on sbt-giter8-0.16.0

    Update sbt-giter8 to 0.16.0 (compare)

  • 13:00
    http4s-steward[bot] synchronize #750
  • 13:00

    http4s-steward[bot] on series

    Update sbt-http4s-org to 0.14.6… Filter binary checking issue ou… Merge pull request #749 from ht… and 9 more (compare)

  • 12:12

    github-actions[bot] on gh-pages

    deploy: 5e00a3062f9fed0f04ab7e6… (compare)

  • 12:06

    rossabaker on 0.23

    flake.lock: Update Flake lock … Merge pull request #6731 from h… (compare)

  • 12:06
    rossabaker closed #6731
  • 11:52
    grouzen edited #6732
Ross A. Baker
@rossabaker
If it were optional, it would fail with a message of our choosing if someone attempts to make an https call and doesn't have it configured.
And it still needs to be lazy, because Some(sslContext.getDefault) is the right choice for most people.
Christopher Davenport
@ChristopherDavenport
lazy should not be our tool to defer.
but, thats for a binary-breaking change.
Ross A. Baker
@rossabaker
Right. I started speculating on either the original or on the PR what we could do when we do break binary.
Christopher Davenport
@ChristopherDavenport
Http1Support should just take SSLContext
Then we need to explicitly deal with it somewhere after server creation.
Ross A. Baker
@rossabaker
Later is another way of making it lazy to defer.
SyncIO makes it lazy and expresses Dragons Be Here.
F[SSLContext] could have a reasonable default.
I don't like the last two because I tend not to like passing effects as parameters.
Christopher Davenport
@ChristopherDavenport
Except we can’t access that.
Our implicits being in last position is really a PITA
I really want (implicit XYZ)(argumentList)
Ross A. Baker
@rossabaker
Yeah.
If we passed Http1Support and F[SslContext], we've got a ConcurrentEffect[F] (which I'm not proud of), and then could run it in the constructor.
Keeping it lazy in Http1Support is still important though.
We couldn't just strictly run that effect in Http1Support, or we'd break people who can't get an SSLContext and don't want one.
Christopher Davenport
@ChristopherDavenport
Really, how do you opt out?
As that seems like a value that could be evaluated and not properly seperated if we are concerned about that.
Ross A. Baker
@rossabaker
After the bug fix, you opt out today by not making https calls or by creating one that works.
Christopher Davenport
@ChristopherDavenport
Right, seems like we really could split that, rather than having a val that could blow up at any moment in a server that doesn’t intend to support http4s
Not really relevant to this iteration, but long term. Why have both in the same thing rather than a coproduct.
Ross A. Baker
@rossabaker
I'm hazy on what we're splitting.
Christopher Davenport
@ChristopherDavenport
SSL capable servers.
Or clients.
Fabio Labella
@SystemFw

I really want (implicit XYZ)(argumentList)

What's the implicit there? (quickly scrolling)

Ross A. Baker
@rossabaker
Oh... well... hmm.
Christopher Davenport
@ChristopherDavenport
But basically the lazy val is what protects us from blowing up.
Ross A. Baker
@rossabaker
We don't have secure and unsecure requests at the type level.
Christopher Davenport
@ChristopherDavenport
@SystemFw (implicit F: Sync[F])(foo : F[XYZ] = F.delay(xyz))
Fabio Labella
@SystemFw
any other arguments before F?
Christopher Davenport
@ChristopherDavenport
No, I want implicit list first.
Fabio Labella
@SystemFw
why?
(not arguing, just need a quick summary)
Christopher Davenport
@ChristopherDavenport
For defaults, I can do it with a partially applied trick. But its dirty. We do this with things like Logger where we take a Option[String => F[Unit]], and if not supplied one we get the default using the sync instance internally.
Fabio Labella
@SystemFw
because at some point I did various tricks, whose implementations are awful, but managed to encode a lot of these weird requirements, so I'd like to play with that
Christopher Davenport
@ChristopherDavenport
But that’s just a workaround for implicit position.
Ross A. Baker
@rossabaker
Add an argument to BlazeClientBuilder in F that defaults to F.delay(...) and you'll get a taste of the problem being discussed. Though that can minimize to other toy examples quite readily.
Every time I've wanted to do that I've later refactored away from it. Maybe it's good that we can't.
Fabio Labella
@SystemFw
I think that's enough
def foo[F[_]: Sync](log: String => F[Unit] = (x: String) => F.delay(println(x)): Thing
that's the problem right?
Ross A. Baker
@rossabaker
I wish we had a failsafe way to create an SSLContext, although the only way to do so would be if we could create one that was guaranteed to fail, in which case it's not too different from an Option... or a lazily guarded one. It's all in the message.
Yeah, that's another variant.
Fabio Labella
@SystemFw
you also want named arguments, or is withLog enough?
Ross A. Baker
@rossabaker
Because the Sync[F] is really in a parameter list after the log.
Uh... withLog would be sufficient for this use case.
Christopher Davenport
@ChristopherDavenport
def logMe[F[_]: Sync](s: String, logAction: Option[String => F[Unit]]): F[Unit] = {
    val log = logAction.getOrElse({s => Sync[F].delay(println(s))})
    log(s)
  }
Option variant
Ross A. Baker
@rossabaker
All of our other configs are inspectable before they're built, so I don't really like the laziness/optionality of it.
Fabio Labella
@SystemFw
you could build a bunch of different apis.
thing.withFoo(...).withBar(...)
thing { builder => builder(foo = myFoo, bar) }