Sorry for my hasty reply, the restriction seems to be not related to Algebraic 
Effects. But I think that Algebraic Effects specifications is useful for a pure 
implementation.

On 2018/11/06 18:44, 森建 wrote:
React Hooks, a new feature of React v16.7.0-alpha, is a hacky implementation, 
so there are restrictions that must be called in order.
https://reactjs.org/docs/hooks-rules.html

One of React members says below:

 > Finally, if you’re a functional programming purist and feel uneasy about 
React relying on mutable state as an implementation detail, you might find it 
satisfactory that handling Hooks could be implemented in a pure way using 
algebraic effects (if JavaScript supported them). And of course React has always 
relied on mutable state internally — precisely so that you don’t have to.

https://medium.com/@dan_abramov/making-sense-of-react-hooks-fdbde8803889

IMHO, it's worth considering that we'll include Algebraic Effects 
specifications in ECMAScript.
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to