4 ms·
I think you're missing the point. The problem of colour is not a problem of limitations. It is indeed a good idea to limit your functions to the least required
by feanaro 5y ago
I think you're missing the point. The problem of colour is not a problem of limitations. It is indeed a good idea to limit your functions to the least required amount of power via the type system. One great way of achieving this is using an algebraic effects system which someone already linked to elsewhere in this thread.
The problem of colour is rather that even though two functions should have the same structure, regardless of their effects, the language still forces you to write two functions each with its own syntactical structure. In type theory terms, this is a problem stemming from a lack of effect polymorphism.
Ideally you'd write one function, polymorphic in its effects, and then just be able to use it in both sync and async contexts. In the sync context, the function's type would specialize in a way that it lacks the `Async` effect, so it wouldn't be able to do async stuff there. In the async context it would specialize in a way that it does have the `Async` effect. Therein you would be unable to apply it in contexts requiring the lack of an `Async` effect.
- mjburgess 5y agoie., we need a color polymoprhism
- staticassertion 5y agoYes, I probably should have expanded my post to say that an effects system is how this should all be handled.