6 ms·
Roc defaults functions to being pure, and functions that can run side effects are inferred to have a different type by the compiler based on usage. By conventio
by rtfeldman 4mo ago
Roc defaults functions to being pure, and functions that can run side effects are inferred to have a different type by the compiler based on usage. By convention, their names should also end in `!` (e.g. `transform` for the name of a pure function and `transform!` if it does side effects), and the compiler warns you if you don't follow that convention.
https://github.com/roc-lang/roc/blob/b2503210da6b58a4ce1254de6a3310e3b5e85f89/docs/langref/functions.md https://github.com/roc-lang/roc/blob/b2503210da6b58a4ce1254d...
- keithasaurus 4mo agoHey - I'm the creator of Blorp, and like a lot of the ideas you have in Roc! Did you consider having opt-in purity? Or some other means of conveying impurity other than "!"?