This is a pretty cool proposal for implicits in Gleam
Conversation
I'm still not sure this is the right direction for the language, but it's certainly a much better fit than type classes
3
1
Modular implicits lets goooo. This is the way I'd like to add ad-hoc polymorphism to Pikelet (using dependent records for modules)!
If you do this, remember not to have complicated rules around disambiguating instances like in Scala – you should fail on any ambiguities.
2
1
But yeah, I'm definitely a fan of using modules/abstract datatypes for bounded polymorphism over traits/type classes. With instance parameters like in Agda and the Modular Implicits proposal for OCaml.

