Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[algebra] Implemented Logic instance for A => Boolean #4301

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

windymelt
Copy link

Hi, I'm new to contribute for this library!

I implemented Logic[A => Boolean] instance for convenience.

Motivation

I want to negate function returns Boolean like this:

import algebra.instances.all

val r = """^b""".r.unanchored

val m = Map(
  "foo" -> 1,
  "bar" -> 2,
  "buzz" -> 3,
)

val matchR = (s: String) => r.matches(s)

m.view.filterKeys(matchR).toMap

val matchNotR = matchR.complement

m.view.filterKeys(matchNotR).toMap

But there is no instance for A => Boolean.

I will follow further instructions because this is first PR for this project...

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.

None yet

1 participant