Hacker News new | past | comments | ask | show | jobs | submit login

They're a bit more than just reducers. Given that you always package them with initial state they're a little more like "left folds" [0] or "Moore machines" [1] (they're isomorphic). What's neat about this is that noticing that structure describes a whole bunch of ways to compose machines and folds—in particular, there's parallel composition like Flux suggests ("all stores receive the same actions", your linked example, https://gist.github.com/gaearon/d77ca812015c0356654f) and sequential ("category-like") composition.

[0] https://hackage.haskell.org/package/foldl-1.1.0/docs/Control...

[1] https://hackage.haskell.org/package/machines-0.5.1/docs/Data...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: