3 ms·
> That... basically amounts to manually bundling values of the concrete type together with the implementation of trait and then passing them around together (al
by lenkite 4y ago
> That... basically amounts to manually bundling values of the concrete type together with the implementation of trait and then passing them around together (also manually), isn't it?
That is more or less similar to implementing the Go interface pointer or Rust "dyn" fat pointer manually. And of-course everyone will do this their own way instead of the language providing the standard.
I make a bet that next major version of Gleam will have traits once its designers are enlightened on the need for the same.
- Joker_vD 4y agoBut can you even do that in Gleam? It's statically-typed after all, so what would the types look like? I guess there is gleam/dynamic with its Dynamic type and from() and decodeN() for coercions but...