3 ms·
I love your Moka example. To me it's so much clearer than either of the others and it's basically what I would write in Haskell. The understandability-complex
by tome 13y ago
I love your Moka example. To me it's so much clearer than either of the others and it's basically what I would write in Haskell.
The understandability-complexity of the Moka style scales linearly with the number of components, because it is written "one-dimensionally". The problem with the imperative style is that its understandability-complexity is superlinear in the number of components because any variable in a nested loop can interact with any other variable.
I also like your use of "keep" as opposed to "filter". I can never remember if "filter" means "filter out" or "filter in"!
- d0m 13y agoThanks. The library was highly inspired from Arc where most of the keywords are short and sweet. (keep, fold, [] shortcut, etc.)