Where communities thrive


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

    github-actions[bot] on gh-pages

    deploy: 3613dede19be87573c7b1ee… (compare)

  • 12:48

    danicheg on promote-native

    (compare)

  • 12:48

    danicheg on main

    Promote Scala Native support on… Merge pull request #6717 from h… (compare)

  • 12:48
    danicheg closed #6717
  • 12:46

    github-actions[bot] on gh-pages

    deploy: f3e23f30c2c950eb377c5ee… (compare)

  • 12:42

    armanbilge on flake-lock-18

    (compare)

  • 12:42

    armanbilge on 0.23

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

  • 12:42
    armanbilge closed #6723
  • Sep 29 20:34

    http4s-steward[bot] on series

    (compare)

  • Sep 29 20:34
    http4s-steward[bot] closed #784
  • Sep 29 20:34
    http4s-steward[bot] commented #784
  • Sep 29 20:34

    http4s-steward[bot] on series

    Update swagger-ui to 4.14.2 in … (compare)

  • Sep 29 20:34
    http4s-steward[bot] opened #786
  • Sep 29 20:34

    http4s-steward[bot] on main

    (compare)

  • Sep 29 20:34
    http4s-steward[bot] closed #783
  • Sep 29 20:33
    http4s-steward[bot] commented #783
  • Sep 29 20:33

    http4s-steward[bot] on main

    Update swagger-ui to 4.14.2 in … (compare)

  • Sep 29 20:33
    http4s-steward[bot] opened #785
  • Sep 29 19:17
    CremboC commented #6718
  • Sep 29 17:25

    github-actions[bot] on gh-pages

    deploy: 86630654b1385b3c7d0687d… (compare)

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) }
Christopher Davenport
@ChristopherDavenport
def logMe[F[_]: Sync] = new logMePartiallyApplied[F]
private class logMePartiallyApplied[F[_]: Sync]{
    def apply(s: String, logAction: String => F[Unit] = {s => Sync[F].delay(println(s))}) = 
      logAction(s)
  }
Partially applied approach.
Ross A. Baker
@rossabaker
I'd like to be able to have a default argument that might fall through to an implementation of last resort, but Java doesn't let us define that for this type.
Fabio Labella
@SystemFw
right, ok
Christopher Davenport
@ChristopherDavenport
The intriguing part to me, is that due to the implicit nature, that partially applied variant is always equivalent.
Fabio Labella
@SystemFw
@ChristopherDavenport I'm not sure the partially applied works, you need a different name
as it stands, logMe[IO]("hello") will think that "hello" is Sync[F]
iirc I did make something similar work at some point, with apply, but it's more horrendous in implementation