3 ms·
Okay, thanks for elaborating. I think the part I had overlooked was the variant constructor not being a function. I had mentally mapped that as a `dispatch` ca
by nirvdrum 7y ago
Okay, thanks for elaborating. I think the part I had overlooked was the variant constructor not being a function.
I had mentally mapped that as a `dispatch` call with the variant being the payload. But, yeah, it looks like the author either made a mistake or took a shortcut there.
- yawaramin 7y agoBuckleScript (ReasonML's-to-JavaScript compiler) has an annotation that automatically creates functions from variant constructors. E.g.: [@bs.deriving {accessors}] type msg = | Increment | Decrement | Reset | Set(int); let action = set(2);