typelevel / algebra

Experimental project to lay out basic algebra type classes
https://typelevel.org/algebra/
Other
378 stars 69 forks source link

Add BoolRng and GenBool. Resolves #107. #109

Closed TomasMikula closed 8 years ago

TomasMikula commented 8 years ago

This is a work in progress on topless Bool/BoolRing (#107), subject to some renaming. In this version I used the names GenBool for generalized Boolean algebra and without(a, b) for a\b (relative complement of b with respect to a).

TomasMikula commented 8 years ago

Although I used the name GenBool for generalized Boolean algebra, I came to like the shortcut less and less, because "Gen" is kind of ambiguous (generic?, org.scalacheck.Gen-related?). I guess I would prefer spelling out GeneralizedBool.

non commented 8 years ago

I'm fine with either of those names. I like @johnynek's idea of just merging this as-is (GenBool) but if you'd rather I am fine with changing the name to GeneralizedBool.

TomasMikula commented 8 years ago

If you are fine with it, then go ahead and merge. How do people feel about without as the name for relative complement. It is an intuitive name for the case of set difference. For logic, the intuition is a butNot b (as a primitive operation, because we don't have not/complement).

non commented 8 years ago

:+1:

non commented 8 years ago

So the idea is that we'd write the relative complement of a in b as b \ a and without(b, a)?

TomasMikula commented 8 years ago

Yes, exactly, so that the argument order of the spelled out name is consistent with the symbolic notation.

non commented 8 years ago

Sounds good to me.

johnynek commented 8 years ago

I think without is fine.