r/ProgrammingLanguages • bruijn, effekt • Apr 27 '26

Discussion Effekt: Name-Based Implicits

https://effekt-lang.org/tour/name-based-implicits

We recently added name-based implicits to our language. It's based on the work by Daan Leijen and Tim Whiting "Syntactic Implicit Parameters with Static Overloading". Let us know of your thoughts!

29 Upvotes

17 comments sorted by

View all comments

Show parent comment

1

u/_marzipankaiser_ Effekt Apr 29 '26 edited Apr 29 '26

The main motivations for this are:

  1. The case for function types, where we eta-expand and the implicits are resolved recursively. So if I have a show(Int) and a show[A](List[A]) which takes a show implicitly (for the A), then show now works on any level of nested lists (so show([[[[[[[[[[42]]]]]]]]]]) compiles and works).
  2. For some special cases, we can change how implicits are instantiated. In particular, the compiler can generate information about the call site (e.g. for assertEquals to print where the assert is called in the code).

For the case of "normal" values being passed like this, we have yet to see if there are good use cases for this.