on master help sign in
VerifiedSemigroup, VerifiedMonoid for List
715940eReynir Björnsson
libs/prelude/Prelude/List.idr+7−4
@@ -232,10 +232,6 @@ instance Semigroup (List a) where
232instance Monoid (List a) where
232instance Monoid (List a) where
233 neutral = []
233 neutral = []
234
234
235−-- XXX: unification failure
236−-- instance VerifiedSemigroup (List a) where
237−-- semigroupOpIsAssociative = appendAssociative
238−
239instance Functor List where
235instance Functor List where
240 map f [] = []
236 map f [] = []
241 map f (x::xs) = f x :: map f xs
237 map f (x::xs) = f x :: map f xs
@@ -811,6 +807,13 @@ hasAnyByNilFalse p (x::xs) =
811hasAnyNilFalse : Eq a => (l : List a) -> hasAny [] l = False
807hasAnyNilFalse : Eq a => (l : List a) -> hasAny [] l = False
812hasAnyNilFalse l = ?hasAnyNilFalseBody
808hasAnyNilFalse l = ?hasAnyNilFalseBody
813
809
810+instance VerifiedSemigroup (List a) where
811+ semigroupOpIsAssociative = appendAssociative
812+
813+instance VerifiedMonoid (List a) where
814+ monoidNeutralIsNeutralL = appendNilRightNeutral
815+ monoidNeutralIsNeutralR xs = Refl
816+
814--------------------------------------------------------------------------------
817--------------------------------------------------------------------------------
815-- Proofs
818-- Proofs
816--------------------------------------------------------------------------------
819--------------------------------------------------------------------------------