[SOLVED] Strange method singnature

In Fabio Labella’s talk about Fibers he presents an example with a signature like that:

def server[F[_]: Concurrent: Timer: ContextShift]: Stream[F, Unit]

Capture.PNG

I tried to get my head around the first line, but I believe there is too much going on, so my question is: What is this Concurrent: Timer: ContextShift part all about? Three types separated by :?

See this thread.

2 Likes

Thank you for your answer! I am not sure if can grasp what this is all about, but one day I’l get to it :slight_smile:

This article looks like a good introduction to type classes/implicits/context bounds (without additional monad/effect/whatever baggage).

2 Likes

Thank you for the link, I will read the article.

But I have to say, that at the moment, I am always unsure how much it is worth the investment of time, since there is the chance, that I have to relearn all those deep-down Scala features and concepts, as soon as Scala 3 is there.

Scala 3 doesn’t change any of those concepts, it just provides a better syntax for them.

And it is possible that the context-bounds sugar syntax would be removed since it won’t help too much anymore.

1 Like

The Scala 3 reference covers these concepts here, using the monoid example from the blog post at one point. I’m not fluent with Scala 3, yet, but at first glance @BalmungSan’s assessment seems to the point: Various syntax changes, but conceptually straightforward, coming from Scala 2.

1 Like