Closed cryogenian closed 9 years ago
I'll add these newtypes, any ideas how to name them?
Maybe Conjunctive
and Disjunctive
? Using the BoolLike
instances might be nice too.
ok, then if &&
stands for *
it will be Conjunctive
I suppose?
Yes, it's still a bit ambiguous. I was thinking of http://en.wikipedia.org/wiki/Conjunctive_normal_form
vs http://en.wikipedia.org/wiki/Disjunctive_normal_form
. Identifying the appropriate thing with (a * b * ...) + (c * d * ...) + ...
(somewhat arbitrarily), I think Conjunctive
ought to mean &&
as +
.
I don't think this is a great naming scheme though. Most Haskell libs only define one instance, for Bool
. The problem there is that Semiring
isn't strong enough to define a Dual
as another Semiring
. We would need a DistributiveLattice
class or something (probably also useful).
Well, BoolLike
is due to be reformed to involve lattice at some point isn't it? (purescript/purescript#907) Maybe we should figure that out if we're doing this now.
Sounds good to me.
added newtypes
Looks cool, but there are two tricky things about this:
Boolean
instances: take yours, and flip(&&)
and(||)
and you'll get a second.I think we should introduce two
newtypes
to solve both these issues.