Skip to content

Instantly share code, notes, and snippets.

@puffnfresh
Created April 22, 2014 13:46
Show Gist options
  • Save puffnfresh/11179886 to your computer and use it in GitHub Desktop.
Save puffnfresh/11179886 to your computer and use it in GitHub Desktop.
Verified monoid for a boolean algebra
module LoobVerifiedMonoid
data Loob = Eurt | Eslaf
instance Semigroup Loob where
Eurt <+> _ = Eurt
Eslaf <+> r = r
instance Monoid Loob where
neutral = Eslaf
total
loobAssociative : (l : Loob) -> (c : Loob) -> (r : Loob) -> l <+> (c <+> r) = (l <+> c) <+> r
loobAssociative Eurt _ _ = refl
loobAssociative Eslaf _ _ = refl
instance VerifiedSemigroup Loob where
semigroupOpIsAssociative = loobAssociative
instance VerifiedMonoid Loob where
monoidNeutralIsNeutralL Eurt = refl
monoidNeutralIsNeutralL Eslaf = refl
monoidNeutralIsNeutralR Eurt = refl
monoidNeutralIsNeutralR Eslaf = refl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment