Closed rgleichman closed 2 years ago
Yes, "composition" should be used for function composition only in this document. The word "combination" might be more appropriate here. I was referencing "Primitives, Combination, and Abstraction" section from the SICP course. But for some reason I got "combination" mixed with "composition". Would this sound better to you:
See how combination works. We combine a parser some(...) of type Parser(Token, Token) with the function tokval and we get a value of type Parser again, but this time it is Parser(Token, str). Let's put it this way: the set of parsers is closed under the application of >> to a parser and a function of type a -> b.
We should be careful and combine parsers using | so that they don't conflict with each other:
Yes, that sounds better. The rshift docstring talks about "transforming", so that also might be good language to use.
I've replaced the term "composition" with "combination" from the API docs and docstrings. I intend to update the tutorial as well.
Fixed for the new Getting Started guide.
From the tutorial:
As a functional programmer, this is confusing since this is an instance of fmapping, not function composition. Also, the tutorial also uses "composition" to refer to composing two parsers
To me, the first quote would make more sense if it read:
Of course, if someone does not know about functors, this might be confusing.