Closed strake closed 4 years ago
Hey! Yeah, this seems useful! Can we come up with a more descriptive name? Perhaps there's a standard name used in other libraries that fits.
I haven't seen it in many other parsing libraries (unfortunately), so we may be setting precedent. I guess that's all the more reason to choose a good name ☺
Regex-applicative calls it msym
, but also has psym :: (a -> Bool) -> RE a a
, so that name makes more sense there than it would here.
Otherwise the closest analog i have seen is Parsec's tokenPrim
, but that's much more complicated.
How about satisfyMaybe
?
Great, thanks for looking into it!
I find this useful and was surprised to not find it already defined.