Skip to content

Commit

Permalink
feat: Add boolean monoid
Browse files Browse the repository at this point in the history
  • Loading branch information
MikuroXina committed Aug 26, 2022
1 parent 3571d83 commit 85cf720
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/bool.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { Monoid } from "./type-class";

export const andMonoid: Monoid.Monoid<boolean> = {
identity: true,
combine: (l, r) => l && r,
};
export const orMonoid: Monoid.Monoid<boolean> = {
identity: false,
combine: (l, r) => l || r,
};

0 comments on commit 85cf720

Please sign in to comment.