r/ProgrammingLanguages • u/marvinborner bruijn, effekt • Apr 27 '26
Discussion Effekt: Name-Based Implicits
https://effekt-lang.org/tour/name-based-implicitsWe 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
View all comments
Show parent comment
2
u/_marzipankaiser_ Effekt Apr 29 '26 edited Apr 29 '26
Default values are related (and could be easily added to Effekt now, since most of the work apart from parsing them is done already). However, for function arguments, this can do significantly more: Because the implicits are resolved recursively, writing:
println([[42]].show)will be expanded to something equivalent toprintln([[42]].show{ outer => show(outer){ inner => show(inner){ x => show(x) } } }This allows us to use this feature similarly to, e.g., typeclasses in Haskell, but without an explicit declaration of a typeclass. It also reuses all the same rules for naming and overload resolution, so you can have local definitions, namespaces etc (i.e., there is no seperate "This is how typeclass instances are resolved").