Closed sharplet closed 9 years ago
Whoa, fun! Thanks for the PR.
none()
resolves #35, so thanks for that too :smile:
Basically all of these are awesome and you are awesome and I am very grateful :bow:
Just the one question, really; this is golden :star:
Thanks for the lovely comments @robrix, glad you liked it! Took me quite a lot of wading through complex index-munging logic beforeI realised that I could use flatMap
, and magically everything just got simpler. :open_mouth:
Ready when you are.
Oh btw, something else I considered was adding <^>
to wrap >>-
+ pure()
. But that could be another PR.
<^>
in another PR sounds great!
:tada:
I’ve added you as a collaborator @sharplet. Same as on Set
, PRs & review preferred for nontrivial stuff, but you can tag releases and review and such now too if you like.
Also: :star: for your branch name.
:grin:
Let me preface this by saying that may agenda here was ultimately to build the
anyOf()
combinator for my own purposes — I don't know if this is the kind of thing you want to be included in Madness core! But along the way I discovered some interesting and fun things, and if any of them fit then feel free to cherry-pick just those. I've got what I was looking for. :innocent:A brief summary:
inject()
: A name that I came up with for monadicreturn
over parsers. (I'm not super attached to the name.)oneOf()
: Kinda looks likemconcat
over parsers (!), but limited to literals. (I'm guessing thatmconcat
wouldn't really be possible because of the trouble with function types in generic constraints, and the general lack of higher-kinded types.)anyOf()
: That's what I came here for. I'm planning to use this one to parse abbreviated short option strings, e.g.,-la => [-l, -a] // "any of" l or a
. It's interesting, but up to you whether it's suitable for inclusion in Madness.allOf()
: Logical addition to go alongsideanyOf()
. Basically a greedier version that pulls out all the matches from the set of literals.Thanks for the great library, this was a lot of fun! Looking forward to your feedback. :blush: