Proposal to add Implicit Function Types to the Language


Here’s a proposal to add implicit function types to Scala 3. An implicit function type

implicit A => B

is the logical first-class version of an implicit method

def m(implicit x: A): B

Here’s a link to the doc page.


I have already talked at length about the promises of implicit function types, for instance at POPL 2018 or at the D-language conference. In essence,

  • they are a fundamental way of scope injection
  • they promise to make many patterns of implicit parameters more concise
  • they can replace the reader monad at a ~ 10x speedup.

For details I refer you to the talks.

This proposal is open for discussion in the community and will be discussed in our next SIP meeting, where we’ll take all your feedback into account for the approval/dismissal of this feature.

Second batch of Scala 3 SIPs: additions to Scala's type system

I think Implicit Function Types is a great thing.

But it seems that it does not suite for builder pattern in general.
Related link: