3 ms·
What about higher order library functions, since calling a green function from a red context is bad and we have no way to guarantee that a function is blue and
by ismailmaj 3y ago
What about higher order library functions, since calling a green function from a red context is bad and we have no way to guarantee that a function is blue and not green, does this mean the function needs to be unsafe? It would be nice if the conversion from red to green would be done implicitly by the language where there is no ambient executor available, but I'm not sure what would be the implications for intra-task concurrency.
- zozbot234 3y agoPart of the point of effect systems is precisely to allow HOF's to deal with these "color" differences in a consistent way. Similar to how in Rust, an error return is modeled as just an instance of some Option<> or Result<> type instead of some bespoke 'exception', so all HOF's can seamlessly manage the 'exceptional' case.