What if we officially defined "methods" as a thing in Roc, and defined them something like the following?
In Roc, a method is a function which is:
* Exposed by a module
* Takes a nominal type as its first argument
* That nominal type is defined in the same module that exposes the function
(except maybe more concisely/eloquently)
To what end? Just to explain static dispatch more easily?
yeah and like we keep ending up using the term anyway in practice
it feels like trying to get people to not say it will be a pointless battle, so seems more useful to embrace it and make a clear definition so everyone can be on the same page about what it means and implies
Sound good. Something something semantics in imperative clothing :laughing:
Sure
How about naming all functions exposed by the type module "methods"? Since you can call any of them on type: Num.decode(bytes). So maybe instance methods are first arg methods and type methods are module exports? Type module differs from other modules in the way that it also represents type and constructor. It's not only a namespace so its exports feel different, at least for me.
But I don't really care. I think terminology should come naturally so it's better to observe and embrace as it was already mentioned.
Last updated: Jun 16 2026 at 16:19 UTC