HackerTrans
TopNewTrendsCommentsPastAskShowJobs

spicebox

no profile record

comments

spicebox
·il y a 10 mois·discuss
The whole reason that hooks were created was that they could composed, as opposed to stuff like renderprops or mixins. When you create a custom hook that uses a useState and a useEffect, that's composition. They have the caveat that they can only be composed into new hooks, but that's just like async functions only being able to be called from other async functions.
spicebox
·il y a 2 ans·discuss
Matt Levine has talked about how this is how PE firms work too. No Harvard MBA wants to work for a midsize manufacturing firm, but they’d kill to work for a PE firm that going to make them work for their PortCo that’s a midsize manufacturer (but they get to say they work for Apollo)
spicebox
·il y a 3 ans·discuss
Monads don’t compose, effects do. ‘IO a’ works great until until you need to add another effect, for example ‘Maybe’. Then you need to bring in monad transformers and create your own monad combining the two, then rewrite all your code to lift the effects from one monad to the other. And you have to do this every time you want to add a new effect.
spicebox
·il y a 3 ans·discuss
Being able to change the ordering of effects on the fly is a benefit of algebraic-effect systems. As you mentioned `State<S, Result<E, T>>` and `Result<E, State<S, T>>`have very different effects. Algebraic-effects let you switch between the two behaviors when you run the effects, whereas with monad transformers you have to refactor all your code to use `State<S, Result<E, T>>` instead of `Result<E, State<S, T>>` or vice-versa
spicebox
·il y a 3 ans·discuss
Maybe you remember when the Israeli Military killed 223 peaceful protestors and injured over 9,000 more? (https://en.m.wikipedia.org/wiki/2018–2019_Gaza_border_protes...) or when they presided over the massacre of thousands of Lebanese civilians in a refugee camp? (https://en.m.wikipedia.org/wiki/Sabra_and_Shatila_massacre)