Skip to content

Add ‘<&&>’ and ‘<||>’ combinators#79

Open
evincarofautumn wants to merge 1 commit intomrkkrp:masterfrom
evincarofautumn:logical-combinators
Open

Add ‘<&&>’ and ‘<||>’ combinators#79
evincarofautumn wants to merge 1 commit intomrkkrp:masterfrom
evincarofautumn:logical-combinators

Conversation

@evincarofautumn
Copy link

These are often useful for writing lexing predicates (Char -> Bool), as well as for writing verifiers (Parser Bool). I always find myself rewriting them, and this package seems like a good home for them.

This adds both applicative and monadic forms, and a bit of documentation to clarify their different short-circuiting behavior.

Since the possibility space for Bool is so small, the included tests are exhaustive unit tests, instead of using random sampling.

These are often useful for writing lexing predicates (`Char -> Bool`),
as well as for writing verifiers (`Parser Bool`). I always find myself
rewriting them, and this package seems like a good home for them.

This adds both applicative and monadic forms, and a bit of documentation
to clarify their different short-circuiting behavior.

Since the possibility space for `Bool` is so small, the included tests
are exhaustive unit tests, instead of using random sampling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant