4 ms·
> I may have gone overboard; I found it hard to write procedural code in F#, so I split up my procedures into steps, with a type to model each step and a sum ty
by masklinn 9y ago
> I may have gone overboard; I found it hard to write procedural code in F#, so I split up my procedures into steps, with a type to model each step and a sum type to model the whole procedure.
State machines are a great thing, and modelling a state machine as a sum type is reasonably common (it's not the best modelling for all state machines, but it's very good for many).
- sevensor 9y agoI'm glad to see I'm not totally crazy for adopting that pattern! As I'm new to the language, I'm not sure whether I'm holding it right.