Nice I didn’t know about GTCs even though I ran across the syntax before.
Lino Rosa
1

Regular type constraints are placed in the type declaration (under square brackets), while this is a completely separate parameter in a separate parameter list. This way compiler will finish resolving the types from the type constraints (remember, square brackets) and *then* kick in the GTC. It’s a simple implicit parameter just like any other, it’s just that syntax is infix (it’s a type with two generic parameters just like Map or Either so you can view it as, for example, GTC[String, Int]). And yes, they are implicit. If your types S and T are resolved to String and Int, compiler will provide you with a parameter of type GTC[String, Int]. Without the implicit keyword there’s no way compiler could do anything automatically for you; you would need to provide the needed value of type GTC yourself.

Show your support

Clapping shows how much you appreciated Sinisa Louc’s story.